mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6860] [CLOSED] feat(clients): show active profiles per client across nodes #6488
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#6488
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/6860
Author: @icelol
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:feat/client-active-profiles-upstream📝 Commits (1)
b95a1cdfeat(clients): show active profiles per client across nodes📊 Changes
51 files changed (+1325 additions, -13 deletions)
View changed files
➕
docs/ACTIVE_CLIENT_PROFILES.md(+37 -0)➕
docs/images/active-client-profiles.png(+0 -0)📝
frontend/public/openapi.json(+106 -0)📝
frontend/src/api/queryKeys.ts(+1 -0)📝
frontend/src/generated/examples.ts(+6 -0)📝
frontend/src/generated/schemas.ts(+30 -0)📝
frontend/src/generated/types.ts(+8 -0)📝
frontend/src/generated/zod.ts(+11 -0)📝
frontend/src/hooks/useClients.ts(+23 -0)➕
frontend/src/lib/clients/active-profiles.ts(+56 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+8 -0)📝
frontend/src/pages/api-docs/websocket-events.ts(+14 -0)➕
frontend/src/pages/clients/ClientActiveProfiles.stories.tsx(+85 -0)📝
frontend/src/pages/clients/ClientsPage.tsx(+27 -1)📝
frontend/src/pages/clients/RowCells.tsx(+42 -0)📝
frontend/src/schemas/client.ts(+1 -0)➕
frontend/src/test/client-active-profiles-cell.test.tsx(+41 -0)➕
frontend/src/test/client-active-profiles.test.ts(+71 -0)📝
internal/web/controller/api.go(+1 -0)📝
internal/web/controller/client.go(+5 -0)...and 31 more files
📄 Description
Summary
Show each client's live authenticated profile names in the clients table and mobile card, including simultaneous profiles across nodes. This draft is paired with an additive Xray stats proposal; it does not request immediate merge.
Companion Xray draft: https://github.com/XTLS/Xray-core/pull/7186
Why
A shared account can use VLESS on one node and Hysteria2 on another at the same time. Aggregate online users, inbound byte counters, and a shared source IP cannot reliably attribute those profiles to that account. This view uses the authenticated email, physical node GUID, inbound tag, and client attachments together instead.
Type of change
Areas affected
No database migrations, credentials/subscription changes, bot changes, server deployment scripts, or port changes are included.
Implementation and compatibility
POST /panel/api/clients/activeProfilesand reuse the existing traffic WebSocket. The frontend uses one aggregate query, not a request per row; the existing memoized Ant Design cells/chips are retained.Unavailable; accurate profile attribution requires the companion core change. Optional real-core tests skip explicitly without a provided executable.docs/ACTIVE_CLIENT_PROFILES.mdfor the contract and limits.How was this tested?
Local Linux/amd64 build with the normal official module pin, without a forked module replacement or Go workspace:
Frontend: 163 files / 1,753 unit and component tests passed. The real-core test opens local VLESS and Hysteria2 tunnels, verifies simultaneous profiles, users behind the same source IP, idle open links and removal on disconnect. TLS is verified against the test certificate, not bypassed. Regression tests also cover stale snapshots, deep copies, node GUID/tag remapping, attachment matching, protobuf compatibility/malformed metadata and API scopes.
Headless Google Chrome checked the synthetic concurrent, disconnected and unsupported-core Storybook states without browser exceptions. The complete upstream CI matrix (including PostgreSQL, all Storybook browser tests and cross-platform checks) is not claimed as locally completed.
Screenshots / recordings
Component preview with synthetic client rows, using the existing panel theme/components; no production clients or secrets:
Breaking changes
None. Existing core versions continue working with an unknown state in the new column. There are no schema migrations or traffic counter resets. The proposed Xray fields remain open for API review while both PRs are drafts.
Checklist
go build ./...and the local Go test suite pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.