mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-28 20:37:48 +02:00
store compact RSSI stats and skip real-time collection
Stats.WiFi is now map[string]int8 (json "wf") holding only available RSSI readings; SSID and unavailable signals stay in Info.WiFi. Averages are rounded to whole dBm. Wi-Fi is collected only on the default 60s interval; real-time requests reuse the last snapshot to avoid spawning osascript / dumping the BSS cache every second.
This commit is contained in:
@@ -20,7 +20,7 @@ export function WiFiChart({
|
||||
const dataPoints = interfaces.map(([id, current]) => ({
|
||||
label: current.s ? `${id} (${current.s})` : id,
|
||||
color: wifiColor(id),
|
||||
dataKey: ({ stats }: SystemStatsRecord) => stats?.wifi?.[id]?.r,
|
||||
dataKey: ({ stats }: SystemStatsRecord) => stats?.wf?.[id],
|
||||
}))
|
||||
return (
|
||||
<ChartCard
|
||||
|
||||
3
internal/site/src/types.d.ts
vendored
3
internal/site/src/types.d.ts
vendored
@@ -91,7 +91,6 @@ export interface SystemInfo {
|
||||
}
|
||||
|
||||
export interface SystemStats {
|
||||
wifi?: Record<string, WiFi>
|
||||
/** cpu percent */
|
||||
cpu: number
|
||||
/** peak cpu */
|
||||
@@ -168,6 +167,8 @@ export interface SystemStats {
|
||||
bat?: [number, BatteryState]
|
||||
/** battery percentages by device name */
|
||||
bats?: Record<string, number>
|
||||
/** Wi-Fi RSSI (dBm) by interface */
|
||||
wf?: Record<string, number>
|
||||
/** network interfaces [upload bytes, download bytes, total upload bytes, total download bytes] */
|
||||
ni?: Record<string, [number, number, number, number]>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user