mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-31 18:27:45 +00:00
[WIFI-10957] Device statistics now using SSID counters when displaying upstream interfaces
Signed-off-by: Charles <charles.bourque96@gmail.com>
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.8.0(40)",
|
"version": "2.8.0(41)",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.8.0(40)",
|
"version": "2.8.0(41)",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "^2.0.11",
|
"@chakra-ui/icons": "^2.0.11",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.8.0(40)",
|
"version": "2.8.0(41)",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.tsx",
|
"main": "index.tsx",
|
||||||
|
|||||||
@@ -64,6 +64,18 @@ type DeviceInterfaceStatistics = {
|
|||||||
};
|
};
|
||||||
tx_retries: number;
|
tx_retries: number;
|
||||||
}[];
|
}[];
|
||||||
|
counters?: {
|
||||||
|
collisions: number;
|
||||||
|
multicast: number;
|
||||||
|
rx_bytes: number;
|
||||||
|
rx_dropped: number;
|
||||||
|
rx_errors: number;
|
||||||
|
rx_packets: number;
|
||||||
|
tx_bytes: number;
|
||||||
|
tx_dropped: number;
|
||||||
|
tx_errors: number;
|
||||||
|
tx_packets: number;
|
||||||
|
};
|
||||||
bssid: string;
|
bssid: string;
|
||||||
iface: string;
|
iface: string;
|
||||||
location: string;
|
location: string;
|
||||||
|
|||||||
@@ -73,8 +73,17 @@ export const useStatisticsCard = ({ serialNumber }: Props) => {
|
|||||||
memoryData.recorded.push(stat.recorded);
|
memoryData.recorded.push(stat.recorded);
|
||||||
|
|
||||||
for (const inter of stat.data.interfaces ?? []) {
|
for (const inter of stat.data.interfaces ?? []) {
|
||||||
const rx = inter.counters?.rx_bytes ?? 0;
|
const isInterUpstream = inter.name?.substring(0, 2) === 'up';
|
||||||
const tx = inter.counters?.tx_bytes ?? 0;
|
let rx = inter.counters?.rx_bytes ?? 0;
|
||||||
|
let tx = inter.counters?.tx_bytes ?? 0;
|
||||||
|
|
||||||
|
if (isInterUpstream) {
|
||||||
|
for (const ssid of inter.ssids ?? []) {
|
||||||
|
rx += ssid.counters?.rx_bytes ?? 0;
|
||||||
|
tx += ssid.counters?.tx_bytes ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let rxDelta = rx - (previousRx[inter.name] ?? 0);
|
let rxDelta = rx - (previousRx[inter.name] ?? 0);
|
||||||
if (rxDelta < 0) rxDelta = 0;
|
if (rxDelta < 0) rxDelta = 0;
|
||||||
let txDelta = tx - (previousTx[inter.name] ?? 0);
|
let txDelta = tx - (previousTx[inter.name] ?? 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user