GUI2 Bug fixes to Topo view
Change-Id: Ib40279fec94ffecb1d6c771aa376ad1cded03c02
diff --git a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/link.ts b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/link.ts
index 28f0b7c..7192de0 100644
--- a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/link.ts
+++ b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/link.ts
@@ -59,6 +59,29 @@
return ep;
}
+ /**
+ * The WSS event showHighlights is sent up with a slightly different
+ * name format on the link id using the "-" separator rather than the "~"
+ * @param linkId The id of the link in either format
+ */
+ public static linkIdFromShowHighlights(linkId: string) {
+ if (linkId.includes('-')) {
+ const parts: string[] = linkId.split('-');
+ const part0 = Link.removeHostPortNum(parts[0]);
+ const part1 = Link.removeHostPortNum(parts[1]);
+ return part0 + '~' + part1;
+ }
+ return linkId;
+ }
+
+ private static removeHostPortNum(hostStr: string) {
+ if (hostStr.includes('/None/')) {
+ const subparts = hostStr.split('/');
+ return subparts[0] + '/' + subparts[1];
+ }
+ return hostStr;
+ }
+
constructor(source, target) {
this.source = source;
this.target = target;
@@ -88,4 +111,5 @@
id: string;
css: string;
label: string;
+ fadems: number;
}