diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/base_dashlet.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/base_dashlet.js index 8789fb87..9e81018e 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/base_dashlet.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/base_dashlet.js @@ -8,6 +8,10 @@ export class BaseDashlet { this.setupDone = false; } + canBeSlowedDown() { + return false; + } + sizeClasses() { switch (this.size) { case 1: return ["col-xs-12", "col-sm-12", "col-md-6", "col-lg-3", "col-xl-1", "col-xxl-1"]; diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/circuit_capacity_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/circuit_capacity_dash.js index e46029e4..18aaf6f2 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/circuit_capacity_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/circuit_capacity_dash.js @@ -8,6 +8,10 @@ export class CircuitCapacityDash extends BaseDashlet { super(slot); } + canBeSlowedDown() { + return true; + } + title() { return "Circuits At Capacity"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/combined_top_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/combined_top_dash.js index 2034b589..f0922905 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/combined_top_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/combined_top_dash.js @@ -22,4 +22,8 @@ export class CombinedTopDashlet extends BaseCombinedDashlet { title() { return "Top-10 Downloaders"; } + + canBeSlowedDown() { + return true; + } } \ No newline at end of file diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/dashboard.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/dashboard.js index 58f9d32f..14eb6493 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/dashboard.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/dashboard.js @@ -15,6 +15,17 @@ export class Dashboard { this.dashletIdentities = this.layout.dashlets; this.dashlets = []; this.channels = []; + this.paused = false; + + let cadence = localStorage.getItem("dashCadence"); + if (cadence === null) { + this.cadence = 1; + localStorage.setItem("dashCadence", this.cadence.toString()); + } else { + this.cadence = parseInt(cadence); + } + this.tickCounter = 0; + this.#editButton(); if (localStorage.getItem("forceEditMode")) { localStorage.removeItem("forceEditMode"); @@ -29,13 +40,7 @@ export class Dashboard { #editButton() { let editDiv = document.createElement("div"); editDiv.id = this.divName + "_edit"; - editDiv.style.position = "absolute"; - editDiv.style.right = "5px"; - editDiv.style.top = "5px"; - editDiv.style.width = "40px"; - editDiv.style.zIndex = "100"; - editDiv.style.opacity = 0.5; - editDiv.innerHTML = ""; + editDiv.innerHTML = ""; editDiv.onclick = () => { if (this.editingDashboard) { this.closeEditMode(); @@ -43,7 +48,44 @@ export class Dashboard { this.editMode(); } }; - this.parentDiv.appendChild(editDiv); + let parent = document.getElementById("controls"); + + // Cadence Picker + let cadenceDiv = document.createElement("div"); + cadenceDiv.id = this.divName + "_cadence"; + let cadenceLabel = document.createElement("label"); + cadenceLabel.htmlFor = "cadencePicker"; + cadenceLabel.innerText = "Update Cadence (Seconds): "; + let cadencePicker = document.createElement("input"); + cadencePicker.id = "cadencePicker"; + cadencePicker.type = "number"; + cadencePicker.min = "1"; + cadencePicker.max = "60"; + cadencePicker.value = this.cadence; + cadencePicker.onchange = () => { + this.cadence = parseInt(cadencePicker.value); + localStorage.setItem("dashCadence", this.cadence.toString()); + } + cadenceDiv.appendChild(cadenceLabel); + cadenceDiv.appendChild(cadencePicker); + + // Pause Button + let pauseDiv = document.createElement("div"); + pauseDiv.id = this.divName + "_pause"; + pauseDiv.innerHTML = ""; + pauseDiv.onclick = () => { + this.paused = !this.paused; + let target = document.getElementById(this.divName + "_pause"); + if (this.paused) { + target.innerHTML = ""; + } else { + target.innerHTML = ""; + } + }; + + parent.appendChild(editDiv); + parent.appendChild(pauseDiv); + parent.appendChild(cadenceDiv); } build() { @@ -98,8 +140,14 @@ export class Dashboard { } } else { // Propagate the message - for (let i=0; iEthernet Protocols

Bytes and packets transferred over IPv4 and IPv6, and the round-trip time for each. This data is gathered from recently completed flows, and may be a little behind realtime.

"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js index 679e8a0b..6a51e927 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js @@ -11,6 +11,10 @@ export class IpProtocols extends BaseDashlet { return "IP Protocols"; } + canBeSlowedDown() { + return true; + } + tooltip() { return "
IP Protocols

Bytes transferred over TCP/UDP/ICMP and port numbers, matched to common services when possible. This data is gathered from recently completed flows, and may be a little behind realtime.

"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10_downloaders.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10_downloaders.js index df1f8b6e..ff9f3935 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10_downloaders.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10_downloaders.js @@ -28,6 +28,10 @@ export class Top10Downloaders extends BaseDashlet { return base; } + canBeSlowedDown() { + return true; + } + setup() { super.setup(); } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_bytes.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_bytes.js index 89d919ec..23d4a43f 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_bytes.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_bytes.js @@ -9,6 +9,10 @@ export class Top10FlowsBytes extends BaseDashlet { this.rttCache = new RttCache(); } + canBeSlowedDown() { + return true; + } + title() { return "Top 10 Flows (by total bytes)"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_rate.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_rate.js index 9affad6a..fee7c40a 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_rate.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top10flows_rate.js @@ -9,6 +9,10 @@ export class Top10FlowsRate extends BaseDashlet { this.rttCache = new RttCache(); } + canBeSlowedDown() { + return true; + } + title() { return "Top 10 Flows (by rate)"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top_tree_summary.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top_tree_summary.js index 35a97a38..8886b6b5 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top_tree_summary.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/top_tree_summary.js @@ -7,6 +7,10 @@ export class TopTreeSummary extends BaseDashlet { super(slot); } + canBeSlowedDown() { + return true; + } + title() { return "Network Tree"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/tree_capacity_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/tree_capacity_dash.js index 78d67351..cbe24169 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/tree_capacity_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/tree_capacity_dash.js @@ -7,6 +7,10 @@ export class TreeCapacityDash extends BaseDashlet { super(slot); } + canBeSlowedDown() { + return true; + } + title() { return "Tree Nodes At Capacity"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_downloaders.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_downloaders.js index aaff76fe..eac31148 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_downloaders.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_downloaders.js @@ -9,6 +9,10 @@ export class Worst10Downloaders extends BaseDashlet { super(slot); } + canBeSlowedDown() { + return true; + } + title() { return "Worst 10 Round-Trip Time"; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_retransmits.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_retransmits.js index 7b8299eb..27681922 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_retransmits.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/worst10_retransmits.js @@ -9,6 +9,10 @@ export class Worst10Retransmits extends BaseDashlet { super(slot); } + canBeSlowedDown() { + return true; + } + title() { return "Worst 10 TCP Re-transmits"; } diff --git a/src/rust/lqosd/src/node_manager/static2/index.html b/src/rust/lqosd/src/node_manager/static2/index.html index 25b99f3d..c46360b4 100644 --- a/src/rust/lqosd/src/node_manager/static2/index.html +++ b/src/rust/lqosd/src/node_manager/static2/index.html @@ -1,4 +1,7 @@ -
+
+
+
+