2.5.39: statistics for v1 interfaces fix

This commit is contained in:
Charles
2022-02-07 22:05:05 +00:00
parent 54f5912da6
commit b3fb45dd36
3 changed files with 16 additions and 9 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.38", "version": "2.5.39",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.38", "version": "2.5.39",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.38", "version": "2.5.39",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -145,16 +145,23 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
totalRx += assoc.rx_bytes ?? 0; totalRx += assoc.rx_bytes ?? 0;
} }
} else { } else {
totalTx += assoc.tx_bytes - prevTx ?? 0; totalTx += assoc.tx_bytes ?? 0;
totalRx += assoc.rx_bytes - prevRx ?? 0; totalRx += assoc.rx_bytes ?? 0;
} }
} }
} }
} }
prevTx = Math.floor(totalTx / 1024); if (version > 0) {
prevRx = Math.floor(totalRx / 1024); const tx = Math.floor(totalTx / 1024);
interfaceList[interfaceTypes[inter.name]][0].data.push(prevTx); const rx = Math.floor(totalRx / 1024);
interfaceList[interfaceTypes[inter.name]][1].data.push(prevRx); interfaceList[interfaceTypes[inter.name]][0].data.push(tx - prevTx);
interfaceList[interfaceTypes[inter.name]][1].data.push(rx - prevRx);
prevTx = tx;
prevRx = rx;
} else {
interfaceList[interfaceTypes[inter.name]][0].data.push(Math.floor(totalTx / 1024));
interfaceList[interfaceTypes[inter.name]][1].data.push(Math.floor(totalRx / 1024));
}
} else { } else {
interfaceList[interfaceTypes[inter.name]][0].data.push( interfaceList[interfaceTypes[inter.name]][0].data.push(
inter.counters ? Math.floor(inter.counters.tx_bytes) : 0, inter.counters ? Math.floor(inter.counters.tx_bytes) : 0,