mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
colored relationships #724
This commit is contained in:
@@ -583,9 +583,9 @@ function getChildren(node, list, path, visited = [])
|
||||
icon: node.devIcon,
|
||||
type: node.devType,
|
||||
status: node.devStatus,
|
||||
hasChildren: children.length > 0 || hiddenMacs.includes(node.mac),
|
||||
hasChildren: children.length > 0 || hiddenMacs.includes(node.devMac),
|
||||
relType: node.devParentRelType,
|
||||
hiddenChildren: hiddenMacs.includes(node.mac),
|
||||
hiddenChildren: hiddenMacs.includes(node.devMac),
|
||||
qty: children.length,
|
||||
children: children
|
||||
};
|
||||
@@ -775,20 +775,11 @@ function initTree(myHierarchy)
|
||||
hasFlatData: false,
|
||||
relationnalField: "children",
|
||||
linkWidth: (nodeData) => 3,
|
||||
linkColor: (nodeData) => {
|
||||
linkColor: (nodeData) => {
|
||||
|
||||
switch (nodeData.data.relType) {
|
||||
case "default":
|
||||
return "#ffcc80"; // yellow
|
||||
break;
|
||||
case "nic":
|
||||
return "#dd4b39"; // red
|
||||
break;
|
||||
|
||||
default:
|
||||
return "#ffcc80";
|
||||
break;
|
||||
}
|
||||
relConf = getRelationshipConf(nodeData.data.relType)
|
||||
|
||||
return relConf.color;
|
||||
}
|
||||
// onNodeClick: (nodeData) => handleNodeClick(nodeData),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user