mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7100] feat(nodes): show per-client live speed for clients served by nodes #6652
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6652
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/7100
Author: @bazil1981
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:feat/node-client-speed-main📝 Commits (1)
2c052cafeat(nodes): show per-client live speed for clients served by nodes📊 Changes
7 files changed (+257 additions, -35 deletions)
View changed files
📝
docs/public/openapi.json(+3 -2)📝
frontend/public/openapi.json(+3 -2)📝
frontend/src/hooks/useClients.ts(+11 -4)📝
frontend/src/pages/api-docs/websocket-events.ts(+3 -2)📝
frontend/src/test/clients-summary.test.tsx(+35 -0)➕
internal/web/job/node_client_speed_test.go(+86 -0)📝
internal/web/job/node_traffic_sync_job.go(+116 -25)📄 Description
The clients page shows a live up/down speed for each client, but only for traffic seen by the local Xray (and TUIC) poll. Clients connected through a managed node never got a speed, even though the master already pulls their cumulative counters from the node every 5s; only per-inbound node speed (nodeTraffics) was derived.
NodeTrafficSyncJob now diffs each node's per-client counters (taken from the inbound list snapshot it already fetches) against the previous successful poll, using the same normalization as the per-inbound node speed: deltas are scaled to the 5s window by real elapsed time, idle counters hold their change timestamp, and resets rebaseline. Baselines are kept per node, so a client served by several nodes is summed correctly, and are pruned when a node is deleted.
The deltas go out as a separate traffic event with clientTrafficSource "node" (the existing clientTraffics/source/interval shape already used by TUIC), so the clients page keeps them apart from the local Xray samples and adds them up instead of overwriting each other.
Claude-Session: https://claude.ai/code/session_01CtECBQEVCFxy9hEwY8TgAi
Summary
Why
Type of change
Areas affected
How was this tested?
Screenshots / recordings
Breaking changes
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.