Implement statistics counters

This commit is contained in:
logicog
2025-08-20 10:06:14 +02:00
parent 2241db371f
commit cc55131fed
+8 -8
View File
@@ -4,10 +4,10 @@ function fillStats() {
for (let i = 0; i < 6; i++) {
console.log("Table Update row: " + i + " state " + pState[i] + " is " + linkS[pState[i] +1]);
tbl.rows[i+1].cells[1].innerHTML = `${linkS[pState[i]+1]}`;
tbl.rows[i+1].cells[2].innerHTML = `${txG[i]} Byte`;
tbl.rows[i+1].cells[3].innerHTML = `${txB[i]} Byte`;
tbl.rows[i+1].cells[4].innerHTML = `${rxG[i]} Byte`;
tbl.rows[i+1].cells[5].innerHTML = `${rxB[i]} Byte`;
tbl.rows[i+1].cells[2].innerHTML = `${txG[i]} pkts`;
tbl.rows[i+1].cells[3].innerHTML = `${txB[i]} pkts`;
tbl.rows[i+1].cells[4].innerHTML = `${rxG[i]} pkts`;
tbl.rows[i+1].cells[5].innerHTML = `${rxB[i]} pkts`;
}
} else {
for (let i = 0; i < 6; i++) {
@@ -15,10 +15,10 @@ function fillStats() {
const tr = tbl.insertRow();
let td = tr.insertCell(); td.appendChild(document.createTextNode(`Port ${i+1}`));
td = tr.insertCell(); td.appendChild(document.createTextNode(`${linkS[pState[i]+1]}`));
td = tr.insertCell(); td.appendChild(document.createTextNode(`${txG[i]} Byte`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${txB[i]} Byte`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${rxG[i]} Byte`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${rxB[i]} Byte`));
td = tr.insertCell(); td.appendChild(document.createTextNode(`${txG[i]} pkts`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${txB[i]} pkts`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${rxG[i]} pkts`));
td = tr.insertCell();td.appendChild(document.createTextNode(`${rxB[i]} pkts`));
}
}
}