diff --git a/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js b/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js index ac265a0c..353cbe47 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js @@ -124,12 +124,28 @@ function fillTable() { target.appendChild(pages); } +function countCircuits() { + let entries = {}; + shapedDevices.forEach((d) => { + if (!entries.hasOwnProperty(d.circuit_id)) { + entries[d.circuit_id] = 1; + } + }) + let count = 0; + for (const i in entries) { + count++; + } + return count; +} + function loadDevices() { $.get("/local-api/devicesAll", (data) => { //console.log(data); shapedDevices = data; displayDevices = data; fillTable(); + $("#count").text(shapedDevices.length + " devices"); + $("#countCircuit").text(countCircuits() + " circuits"); }) } diff --git a/src/rust/lqosd/src/node_manager/static2/shaped_devices.html b/src/rust/lqosd/src/node_manager/static2/shaped_devices.html index 490bae9d..5a0fd529 100644 --- a/src/rust/lqosd/src/node_manager/static2/shaped_devices.html +++ b/src/rust/lqosd/src/node_manager/static2/shaped_devices.html @@ -1,6 +1,6 @@
-
Shaped Devices
+
Shaped Devices ? ?