mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 05:04:22 +00:00
The clients page summary counters (Online / Depleted / Depleting / Disabled / Active) came only from the paged-list response (staleTime: Infinity), so they stayed frozen until a manual refresh or a mutation-triggered refetch — the per-row columns updated over WebSocket but the summary card did not. The client_stats WS event already broadcasts every client's traffic (enable/up/down/total/expiryTime) every few seconds, so recompute the summary client-side from it: computeClientsSummary mirrors the server's buildClientsSummary, the latest event is stored in allClientStats, and the summary is a useMemo over that plus the live onlines set. Falls back to the server summary until the first event lands and keeps the server's authoritative total. No extra polling, consistent with the existing no-REST-fallback traffic design. |
||
|---|---|---|
| .. | ||
| useClients.ts | ||
| useDatepicker.ts | ||
| useMediaQuery.ts | ||
| usePageTitle.ts | ||
| useTheme.tsx | ||
| useWebSocket.ts | ||
| useXraySetting.ts | ||