mirror of
				https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
				synced 2025-10-31 10:17: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", | ||||
|   "version": "2.8.0(40)", | ||||
|   "version": "2.8.0(41)", | ||||
|   "lockfileVersion": 2, | ||||
|   "requires": true, | ||||
|   "packages": { | ||||
|     "": { | ||||
|       "name": "ucentral-client", | ||||
|       "version": "2.8.0(40)", | ||||
|       "version": "2.8.0(41)", | ||||
|       "license": "ISC", | ||||
|       "dependencies": { | ||||
|         "@chakra-ui/icons": "^2.0.11", | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "ucentral-client", | ||||
|   "version": "2.8.0(40)", | ||||
|   "version": "2.8.0(41)", | ||||
|   "description": "", | ||||
|   "private": true, | ||||
|   "main": "index.tsx", | ||||
|   | ||||
| @@ -64,6 +64,18 @@ type DeviceInterfaceStatistics = { | ||||
|       }; | ||||
|       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; | ||||
|     iface: string; | ||||
|     location: string; | ||||
|   | ||||
| @@ -73,8 +73,17 @@ export const useStatisticsCard = ({ serialNumber }: Props) => { | ||||
|         memoryData.recorded.push(stat.recorded); | ||||
|  | ||||
|         for (const inter of stat.data.interfaces ?? []) { | ||||
|           const rx = inter.counters?.rx_bytes ?? 0; | ||||
|           const tx = inter.counters?.tx_bytes ?? 0; | ||||
|           const isInterUpstream = inter.name?.substring(0, 2) === 'up'; | ||||
|           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); | ||||
|           if (rxDelta < 0) rxDelta = 0; | ||||
|           let txDelta = tx - (previousTx[inter.name] ?? 0); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Charles
					Charles