mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
Rewrites useInbounds so its four server fetches (slim list, default settings, online clients, last-online map) live in useQuery with staleTime: Infinity. The in-place WS merge logic for traffic and client_stats is preserved — applyTrafficEvent / applyClientStatsEvent still mutate the locally-mirrored dbInbounds so the panel doesn't refetch every 1-2 seconds when stats stream in. refresh() becomes a thin invalidateQueries on the three list keys, which mutations in the page already call after add/edit/del. The bridge now forwards the WebSocket 'inbounds' push to setQueryData(['inbounds', 'slim']), and InboundsPage drops its useEffect(fetchDefaultSettings → refresh) plus the invalidate / inbounds wiring on useWebSocket — both are owned by the bridge now.
23 lines
625 B
TypeScript
23 lines
625 B
TypeScript
export const keys = {
|
|
server: {
|
|
status: () => ['server', 'status'] as const,
|
|
},
|
|
nodes: {
|
|
root: () => ['nodes'] as const,
|
|
list: () => ['nodes', 'list'] as const,
|
|
},
|
|
settings: {
|
|
root: () => ['settings'] as const,
|
|
all: () => ['settings', 'all'] as const,
|
|
defaults: () => ['settings', 'defaults'] as const,
|
|
},
|
|
inbounds: {
|
|
root: () => ['inbounds'] as const,
|
|
slim: () => ['inbounds', 'slim'] as const,
|
|
},
|
|
clients: {
|
|
root: () => ['clients'] as const,
|
|
onlines: () => ['clients', 'onlines'] as const,
|
|
lastOnline: () => ['clients', 'lastOnline'] as const,
|
|
},
|
|
} as const;
|