mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-05 18:24:49 +03:00
3af2da0142
The inbounds page and Nodes page checked each client's email against a single deduped union of every node's online clients, so a client connected to one node showed as online on every inbound across every node. The local online set was also derived from the email-keyed client_traffics.last_online column, which remote-node syncs bump too, leaking remote-only clients onto local inbounds. Track online clients per node: the local panel's own xray clients under key 0 (derived from live traffic-poll deltas via RefreshLocalOnline, kept in memory and independent of the shared last_online column) and each remote node under its id. Add GetOnlineClientsByNode plus a /clients/onlinesByNode endpoint and onlineByNode WS field; node.go and the inbounds rollup now scope online by node. The flat GetOnlineClients union is kept for client-centric and total-count views (Clients page, dashboard, telegram). Closes #4809
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
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,
|
|
options: () => ['inbounds', 'options'] as const,
|
|
},
|
|
clients: {
|
|
root: () => ['clients'] as const,
|
|
list: (params: unknown) => ['clients', 'list', params] as const,
|
|
all: () => ['clients', 'all'] as const,
|
|
onlines: () => ['clients', 'onlines'] as const,
|
|
onlinesByNode: () => ['clients', 'onlinesByNode'] as const,
|
|
lastOnline: () => ['clients', 'lastOnline'] as const,
|
|
groups: () => ['clients', 'groups'] as const,
|
|
},
|
|
xray: {
|
|
root: () => ['xray'] as const,
|
|
config: () => ['xray', 'config'] as const,
|
|
outboundsTraffic: () => ['xray', 'outboundsTraffic'] as const,
|
|
},
|
|
} as const;
|