mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Shaped Devices page includes a count of devices and circuits
This commit is contained in:
parent
8d242ee2e8
commit
e4840583a3
@ -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");
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h5><i class="fa fa-group"></i> Shaped Devices</h5>
|
||||
<h5><i class="fa fa-group"></i> Shaped Devices <span class="badge" id="count">?</span> <span class="badge" id="countCircuit">?</span></h5>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div id="deviceTable">
|
||||
|
Loading…
Reference in New Issue
Block a user