mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6799] [CLOSED] fix(online): attribute online clients to the inbound they actually use #6458
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#6458
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/6799
Author: @rasa68
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:fix/multi-inbound-online📝 Commits (3)
485be28fix(online): attribute online clients to the inbound they actually useb57ca0efix(online): address review - docs registry, TUIC/MTProto, stale pairsaf40e42style: format endpoints.ts📊 Changes
25 files changed (+833 additions, -16 deletions)
View changed files
📝
docs/content/docs/en/reference/api/clients.mdx(+1 -1)📝
docs/content/docs/fa/reference/api/clients.mdx(+1 -1)📝
docs/content/docs/ru/reference/api/clients.mdx(+1 -1)📝
docs/content/docs/zh/reference/api/clients.mdx(+1 -1)📝
docs/public/openapi.json(+41 -0)📝
frontend/public/openapi.json(+41 -0)📝
frontend/src/api/queryKeys.ts(+1 -0)📝
frontend/src/hooks/useClients.ts(+34 -0)➕
frontend/src/lib/online-attribution.ts(+14 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+8 -0)📝
frontend/src/pages/clients/ClientsPage.css(+8 -0)📝
frontend/src/pages/clients/ClientsPage.tsx(+56 -6)📝
frontend/src/pages/inbounds/useInbounds.ts(+81 -3)📝
frontend/src/schemas/client.ts(+6 -0)➕
frontend/src/test/online-attribution.test.ts(+31 -0)📝
internal/web/controller/client.go(+5 -0)📝
internal/web/job/node_traffic_sync_job.go(+1 -0)📝
internal/web/job/xray_traffic_job.go(+2 -0)➕
internal/web/service/access_log_clients.go(+177 -0)➕
internal/web/service/access_log_clients_test.go(+82 -0)...and 5 more files
📄 Description
Problem
Xray's per-user stats aggregate across inbounds. For a client attached to several inbounds:
Change
When an Xray access log is configured, a tailer records which inbound each client opens connections on (
email -> inbound tags).xray.Process:RefreshLocalClientInbounds/GetLocalClientInbounds(pairs visible while the client is online and the pair is recent or its inbound is still active).service/access_log_clients.go: incremental, truncation-safe access-log tailer.POST /panel/api/clients/clientInboundsand aclientInboundskey in the traffic websocket payload.Fallback / limits
none(the default): behaviour unchanged (traffic-delta heuristic, single-inbound bot label).Verification status
tsc --noEmitclean;inbounds-ws-identitytest passes.gofmtsyntax check. New tests:internal/xray/online_test.go,service/access_log_clients_test.go,tgbot/online_labels_test.go. Please rely on CI /go test ./....--no-verifybecauseoxlintcrashes in the sandbox;oxfmtwas run.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.