From a5042220ce8d18e0419eeb65a65395cf5c820d6c Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Fri, 19 Jul 2024 09:44:49 -0500 Subject: [PATCH] Tree Overview now supports a "max depth" control. --- .../js_build/src/all_tree_sankey.js | 26 +++++++++++++++++++ .../node_manager/static2/all_tree_sankey.html | 3 +++ 2 files changed, 29 insertions(+) diff --git a/src/rust/lqosd/src/node_manager/js_build/src/all_tree_sankey.js b/src/rust/lqosd/src/node_manager/js_build/src/all_tree_sankey.js index d1493e58..7da350ac 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/all_tree_sankey.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/all_tree_sankey.js @@ -37,6 +37,10 @@ function start() { let links = []; for (let i=0; i maxDepth) { + continue; + } let name = data[i][1].name; let bytes = data[i][1].current_throughput[0]; let bytesAsMegabits = bytes / 1000000; @@ -84,6 +88,28 @@ function start() { }); } +function getMaxDepth() { + let maxDepth = 10; + let storedDepth = localStorage.getItem("atsDepth"); + if (storedDepth !== null) { + maxDepth = parseInt(storedDepth); + } else { + localStorage.setItem("atsDepth", maxDepth.toString()); + } + return maxDepth; +} + +function bindMaxDepth() { + let d = document.getElementById("maxDepth"); + d.value = maxDepth; + d.onclick = () => { + maxDepth = parseInt(d.value); + localStorage.setItem("atsDepth", maxDepth.toString()); + }; +} + +let maxDepth = getMaxDepth(); +bindMaxDepth(); let graph = new AllTreeSankey("sankey"); start(); \ No newline at end of file diff --git a/src/rust/lqosd/src/node_manager/static2/all_tree_sankey.html b/src/rust/lqosd/src/node_manager/static2/all_tree_sankey.html index 4781f811..6a4aa63b 100644 --- a/src/rust/lqosd/src/node_manager/static2/all_tree_sankey.html +++ b/src/rust/lqosd/src/node_manager/static2/all_tree_sankey.html @@ -1,4 +1,7 @@
+
+ +
\ No newline at end of file