3x-ui/frontend/src/hooks
MHSanaei b67c4c2f81
fix(clients): keep the summary card live without a page refresh
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.
2026-06-01 06:10:25 +02:00
..
useClients.ts fix(clients): keep the summary card live without a page refresh 2026-06-01 06:10:25 +02:00
useDatepicker.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
useMediaQuery.ts Frontend rewrite: React + TypeScript with AntD v6 (#4498) 2026-05-23 15:21:45 +02:00
usePageTitle.ts feat(clients,groups): client groups + sub-links export + dedicated groups page 2026-05-27 17:30:55 +02:00
useTheme.tsx Migrate frontend models/api/utils to TypeScript and modernize AntD theming (#4563) 2026-05-25 14:34:53 +02:00
useWebSocket.ts Migrate frontend models/api/utils to TypeScript and modernize AntD theming (#4563) 2026-05-25 14:34:53 +02:00
useXraySetting.ts fix(xray): test UDP outbounds via xray probe (#4657) + Vision testseed & Flow form fixes 2026-05-29 21:07:01 +02:00