mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
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#5753
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/5005
Author: @MHSanaei
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @MHSanaei
Base:
main← Head:feat/multi-hop-node-attribution📝 Commits (6)
3a3f4d7feat(nodes): add stable panel GUID identity (multi-hop phase 0)3d7fd8bfeat(nodes): attribute inbounds to their origin node by GUID (multi-hop phase 1)66bb2dffeat(nodes): key online status by node GUID end-to-end (multi-hop phase 2)e07dd9dfeat(nodes): surface transitive sub-nodes on the master (multi-hop phase 3a)8afd571feat(nodes): render transitive sub-nodes nested + read-only on the Nodes page (multi-hop phase 3b)cb90fedi18n(nodes): translate subNode/subNodeTip across all locales📊 Changes
37 files changed (+1002 additions, -222 deletions)
View changed files
📝
database/model/model.go(+41 -0)📝
frontend/public/openapi.json(+49 -7)📝
frontend/src/api/queryKeys.ts(+1 -1)📝
frontend/src/models/dbinbound.ts(+3 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+11 -5)📝
frontend/src/pages/inbounds/useInbounds.ts(+40 -34)📝
frontend/src/pages/nodes/NodeList.tsx(+72 -15)📝
frontend/src/schemas/node.ts(+5 -0)📝
web/controller/client.go(+4 -4)📝
web/controller/node.go(+1 -1)📝
web/controller/server.go(+9 -0)📝
web/job/node_heartbeat_job.go(+11 -1)📝
web/job/node_traffic_sync_job.go(+2 -2)📝
web/job/xray_traffic_job.go(+2 -2)📝
web/runtime/remote.go(+39 -7)📝
web/service/inbound.go(+123 -9)📝
web/service/node.go(+28 -15)➕
web/service/node_origin_guid_test.go(+71 -0)➕
web/service/node_tree.go(+226 -0)➕
web/service/node_tree_test.go(+81 -0)...and 17 more files
📄 Description
Summary
Adds end-to-end attribution and read-only surfacing of chained sub-nodes (Node1 → Node2 → Node3). Clients and inbounds hosted several hops down a node chain are now attributed to the node that physically hosts them, instead of the intermediate node they sync through, and a node's downstream sub-nodes are shown read-only on the Nodes page.
Why
Closes #4983 (dup #4984).
Per-node online status was keyed by each panel's local autoincrement node id, which is meaningless one hop away. So in a chained topology the master attributed clients running on Node3 to Node2 (the node it syncs through), and Node3 was not visible on the master at all. This change introduces a stable, panel-local
panelGuidas the cross-hop identity so attribution is correct at any depth.Type of change
Areas affected
What changed (by phase)
panelGuid(settings, get-or-create likeGetSecret), returned inpanel/api/server/status; the master learns each node's GUID via heartbeat into a newNode.Guidcolumn. Guarded so an old-build node or a failed probe never clears a known GUID.Inbound.OriginNodeGuid: the GUID of the panel that physically hosts an inbound. Empty = local (filled with the panel's own GUID at serve time); set duringSetRemoteTraffic, preserving a value the node forwarded from its own sub-node so a transitive inbound stays attributed to the deepest node.POST /panel/api/clients/onlinesByGuid(was/onlinesByNode);FetchTrafficSnapshotfalls back to the flat/onlinesfor old-build nodes; WSonlineByGuidfield; the inbounds-page rollup scopes byoriginNodeGuid.GET /panel/api/server/descendants(node API token) publishes a panel's direct nodes; the heartbeat caches them andGetNodeTreesurfaces transitive sub-nodes as read-onlymodel.Nodeprojections with per-GUID recounts.Sub-nodetag. Locale keys translated across all 13 languages.How was this tested?
xray/online_test.go(GUID-tree merge/scoping),web/service/node_tree_test.go(transitive surfacing),web/service/node_origin_guid_test.go(origin attribution). Fullgo build ./...+go testpass; frontendtsc/lint/vitest(408) pass.node3userwas attributed to Node3's GUID at every hop (Node3 → Node2 → master/clients/onlinesByGuid); the master listed Node3 as a transitive node under Node2 (transitive:true,node3.onlineCount=1,node2.onlineCount=0,node3.inboundCount=1), and the inbound carriedoriginNodeGuid = <node3 guid>.Breaking changes
None. Two new nullable columns (
nodes.guid,inbounds.origin_node_guid) are added via AutoMigrate. Old-build nodes that don't report a GUID degrade gracefully to the previous flat behavior via a syntheticnode:<id>key, so a mixed-version fleet keeps working.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.