diff --git a/front/js/network-tree.js b/front/js/network-tree.js index 078239d5..b9d9600d 100644 --- a/front/js/network-tree.js +++ b/front/js/network-tree.js @@ -81,6 +81,7 @@ function getChildren(node, list, path, visited = []) devParentRelType: node.devParentRelType, devVlan: node.devVlan, devSSID: node.devSSID, + devIsEthernet: !isNaN(node.devParentPort) && node.devParentPort !== "", hiddenChildren: hiddenMacs.includes(node.devMac), qty: children.length, children: children @@ -208,7 +209,7 @@ function initTree(myHierarchy) // override original value let screenWidthEm = pxToEm(finalWidthPx); - // handle canvas and node size if only a few nodes + // handle canvas and node size if only a few nodes emSize > 1 ? emSize = 1 : emSize = emSize; let nodeHeightPx = emToPx(emSize*1); @@ -231,7 +232,14 @@ function initTree(myHierarchy) (!emptyArr.includes(nodeData.data.devParentPort)) ? port = nodeData.data.devParentPort : port = ""; - (port == "" || port == 0 || port == 'None' ) ? portBckgIcon = `` : portBckgIcon = ``; + if (nodeData.data.devSSID !== ""){ + portBckgIcon = ``; + } else if (nodeData.data.devIsEthernet) { + portBckgIcon = ``; + } else { + portBckgIcon = ``; + } + portHtml = (port == "" || port == 0 || port == 'None' ) ? "   " : port; @@ -318,6 +326,13 @@ function initTree(myHierarchy) idKey: "devMac", hasFlatData: false, relationnalField: "children", + linkStyle: (nodeData) => { + // Return "solid", "dashed", "dotted", or "dashdot" + // Can vary per link based on node data: + console.log(nodeData.data.devIsEthernet); + + return nodeData.data.devIsEthernet ? "solid" : "dashed"; + }, linkLabel: { render: (parent, child) => { // Return text or HTML to display on the connection line diff --git a/front/js/ui_components.js b/front/js/ui_components.js index 4fcf96fe..77ee5493 100755 --- a/front/js/ui_components.js +++ b/front/js/ui_components.js @@ -1077,7 +1077,7 @@ function initHoverNodeInfo() { const html = `