mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui.git
synced 2025-11-01 19:27:58 +00:00
2.5.36: fix for device statistics version 1
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.35",
|
"version": "2.5.36",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.35",
|
"version": "2.5.36",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.35",
|
"version": "2.5.36",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
|
|||||||
@@ -114,8 +114,11 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Looping through all the data
|
// Looping through all the data
|
||||||
|
let prevTx = 0;
|
||||||
|
let prevRx = 0;
|
||||||
for (const log of sortedData) {
|
for (const log of sortedData) {
|
||||||
// Looping through the interfaces of the log
|
// Looping through the interfaces of the log
|
||||||
|
const version = log.data.version ?? 0;
|
||||||
for (const inter of log.data.interfaces) {
|
for (const inter of log.data.interfaces) {
|
||||||
if (inter.ssids?.length > 0) {
|
if (inter.ssids?.length > 0) {
|
||||||
let totalTx = 0;
|
let totalTx = 0;
|
||||||
@@ -123,12 +126,19 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
|||||||
for (const ssid of inter.ssids) {
|
for (const ssid of inter.ssids) {
|
||||||
if (ssid.associations) {
|
if (ssid.associations) {
|
||||||
for (const assoc of ssid.associations) {
|
for (const assoc of ssid.associations) {
|
||||||
if (assoc.deltas) {
|
if (version === 0) {
|
||||||
totalTx += assoc.deltas?.tx_bytes ?? 0;
|
if (assoc.deltas) {
|
||||||
totalRx += assoc.deltas?.rx_bytes ?? 0;
|
totalTx += assoc.deltas?.tx_bytes ?? 0;
|
||||||
|
totalRx += assoc.deltas?.rx_bytes ?? 0;
|
||||||
|
} else {
|
||||||
|
totalTx += assoc.tx_bytes ?? 0;
|
||||||
|
totalRx += assoc.rx_bytes ?? 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
totalTx += assoc.tx_bytes ?? 0;
|
totalTx += assoc.tx_bytes - prevTx ?? 0;
|
||||||
totalRx += assoc.rx_bytes ?? 0;
|
totalRx += assoc.rx_bytes - prevRx ?? 0;
|
||||||
|
prevTx = assoc.tx_bytes;
|
||||||
|
prevRx = assoc.rx_bytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,6 +156,16 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (let y = 0; y < interfaceList.length; y += 1) {
|
||||||
|
for (let z = 0; z < interfaceList[y].length; z += 1) {
|
||||||
|
const newArray = interfaceList[y][z].data;
|
||||||
|
if (newArray.length > 0) newArray.shift();
|
||||||
|
interfaceList[y][z].data = newArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newCategories = categories;
|
||||||
|
if (newCategories.length > 0) newCategories.shift();
|
||||||
const interfaceOptions = {
|
const interfaceOptions = {
|
||||||
chart: {
|
chart: {
|
||||||
id: 'chart',
|
id: 'chart',
|
||||||
@@ -160,7 +180,7 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
|||||||
fontSize: '15px',
|
fontSize: '15px',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
categories,
|
categories: newCategories,
|
||||||
tickAmount: areSameDay ? 15 : 10,
|
tickAmount: areSameDay ? 15 : 10,
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
|
|||||||
Reference in New Issue
Block a user