BE+FE: better VLAN/SSID handling

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-02-22 08:08:48 +11:00
parent 6bbfc0637c
commit 2559702a6a
3 changed files with 17 additions and 4 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -611,6 +611,7 @@ function getChildren(node, list, path, visited = [])
hasChildren: children.length > 0 || hiddenMacs.includes(node.devMac),
relType: node.devParentRelType,
devVlan: node.devVlan,
devSSID: node.devSSID,
hiddenChildren: hiddenMacs.includes(node.devMac),
qty: children.length,
children: children
@@ -890,12 +891,18 @@ function initTree(myHierarchy)
linkLabel: {
render: (parent, child) => {
// Return text or HTML to display on the connection line
return child.data.devVlan ?? "";
connectionLabel = (child?.data.devVlan ?? "") + "/" + (child?.data.devSSID ?? "");
if(connectionLabel == "/")
{
connectionLabel = "";
}
return connectionLabel;
// or with HTML:
// return "<tspan><strong>reports to</strong></tspan>";
},
color: "#336c87ff", // Label text color (optional)
fontSize: 11 // Label font size in px (optional)
fontSize: nodeHeightPx - 5 // Label font size in px (optional)
},
linkWidth: (nodeData) => 2,
linkColor: (nodeData) => {

View File

@@ -1516,6 +1516,9 @@
},
{
"function": "devSSID",
"events": [
"add_option"
],
"type": {
"dataType": "string",
"elements": [
@@ -1599,6 +1602,9 @@
},
{
"function": "devVlan",
"events": [
"add_option"
],
"type": {
"dataType": "string",
"elements": [