@@ -94,7 +94,10 @@ export class TopoViewerAdaptorClab {
9494
9595
9696 var clabName = parsed . name
97-
97+ var clabPrefix = parsed . prefix ;
98+ // if (clabPrefix == "") {
99+ // clabPrefix = ""
100+ // }
98101
99102
100103 // Define the EnvironmentJson object
@@ -104,6 +107,7 @@ export class TopoViewerAdaptorClab {
104107
105108 const environmentJson : EnvironmentJson = {
106109 workingDirectory : "." ,
110+ clabPrefix : `${ clabPrefix } ` ,
107111 clabName : `${ clabName } ` ,
108112 clabServerAddress : "" ,
109113 clabAllowedHostname : hostname ,
@@ -112,8 +116,7 @@ export class TopoViewerAdaptorClab {
112116 deploymentType : "vs-code" ,
113117 topoviewerVersion : `${ topoViewerVersion } ` ,
114118 topviewerPresetLayout : `${ this . currentIsPresetLayout . toString ( ) } ` ,
115- envCyTopoJsonBytes : cytoTopology ,
116- envCyTopoJsonBytesAddon : cytoTopology
119+ envCyTopoJsonBytes : cytoTopology
117120 } ;
118121
119122 // Serialize EnvironmentJson with hyphenated keys
@@ -175,9 +178,9 @@ export class TopoViewerAdaptorClab {
175178 * @returns An array of Cytoscape elements (`CyElement[]`) representing nodes and edges.
176179 */
177180 public clabYamlToCytoscapeElements ( yamlContent : string , clabTreeDataToTopoviewer : Record < string , ClabLabTreeNode > | undefined ) : CyElement [ ] {
178- const parsed = yaml . load ( yamlContent ) as ClabTopology ;
179- return this . buildCytoscapeElements ( parsed , { includeContainerData : true , clabTreeData : clabTreeDataToTopoviewer } ) ;
180- }
181+ const parsed = yaml . load ( yamlContent ) as ClabTopology ;
182+ return this . buildCytoscapeElements ( parsed , { includeContainerData : true , clabTreeData : clabTreeDataToTopoviewer } ) ;
183+ }
181184
182185
183186 /**
@@ -193,9 +196,9 @@ export class TopoViewerAdaptorClab {
193196 * @returns An array of Cytoscape elements (`CyElement[]`) representing nodes and edges.
194197 */
195198 public clabYamlToCytoscapeElementsEditor ( yamlContent : string ) : CyElement [ ] {
196- const parsed = yaml . load ( yamlContent ) as ClabTopology ;
197- return this . buildCytoscapeElements ( parsed , { includeContainerData : false } ) ;
198- }
199+ const parsed = yaml . load ( yamlContent ) as ClabTopology ;
200+ return this . buildCytoscapeElements ( parsed , { includeContainerData : false } ) ;
201+ }
199202
200203
201204 /**
@@ -248,6 +251,7 @@ export class TopoViewerAdaptorClab {
248251 private mapEnvironmentJsonToHyphenated ( envJson : EnvironmentJson ) : string {
249252 const hyphenatedJson = {
250253 "working-directory" : envJson . workingDirectory ,
254+ "clab-prefix" : envJson . clabPrefix ,
251255 "clab-name" : envJson . clabName ,
252256 "clab-server-address" : envJson . clabServerAddress ,
253257 "clab-allowed-hostname" : envJson . clabAllowedHostname ,
@@ -256,8 +260,7 @@ export class TopoViewerAdaptorClab {
256260 "deployment-type" : envJson . deploymentType ,
257261 "topoviewer-version" : envJson . topoviewerVersion ,
258262 "topoviewer-layout-preset" : envJson . topviewerPresetLayout ,
259- "EnvCyTopoJsonBytes" : envJson . envCyTopoJsonBytes ,
260- "EnvCyTopoJsonBytesAddon" : envJson . envCyTopoJsonBytesAddon
263+ "EnvCyTopoJsonBytes" : envJson . envCyTopoJsonBytes
261264 } ;
262265
263266 return JSON . stringify ( hyphenatedJson , null , 2 ) ;
@@ -284,6 +287,8 @@ export class TopoViewerAdaptorClab {
284287 log . info ( `######### status preset layout: ${ this . currentIsPresetLayout } ` ) ;
285288
286289 const clabName = parsed . name ;
290+
291+
287292 const parentMap = new Map < string , string | undefined > ( ) ;
288293 let nodeIndex = 0 ;
289294
0 commit comments