feat(nodes): add distinct purple indicator when panel is online but Xray core failed#5040
Open
rqzbeh wants to merge 1 commit into
Open
feat(nodes): add distinct purple indicator when panel is online but Xray core failed#5040rqzbeh wants to merge 1 commit into
rqzbeh wants to merge 1 commit into
Conversation
…ray core failed Currently nodes only show binary online/offline based on panel API reachability. This adds a third state: - Green: panel reachable + Xray healthy - Purple pulsing dot + "Online (Xray Error)": panel API works (management actions still available) but the node Xray process is in error or stopped. Tooltip shows the remote xrayError. - Red: unreachable (unchanged) Backend now captures xray.state + xray.errorMsg from /panel/api/server/status heartbeats and probes. New fields on Node + NodeSummary, forwarded for transitive nodes. Frontend Zod + NodeList rendering + dedicated .xray-error-dot CSS (color #722ED1) + i18n key. Color chosen purple per feedback after initial implementation. Refs: worktree xray-failed-in-nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(nodes): distinct purple indicator when panel is online but Xray core failed
Summary
Currently the Nodes section only shows binary reachability lights (green = online / red = offline) based on whether the central panel can call the remote node's
/panel/api/server/statusover its API token.This change introduces a clear third visual state for better monitoring:
!icon tooltip surfaces the actual error message returned by the remote node.The new state was requested so operators get immediate visibility into "the node is there but Xray is broken" without having to click into the node or check logs.
Color chosen as #722ED1 (Ant Design purple-6) with a matching subtle pulsing animation, per follow-up feedback.
Motivation / Problem
In a multi-node deployment the central panel previously had no first-class way to distinguish:
This led to silent traffic blackholing until someone noticed client complaints or manually checked each node.
Changes
Backend
database/model/model.go: AddedXrayStateandXrayErrorfields toNodeandNodeSummary(with proper json/gorm tags).web/service/node.go:HeartbeatPatchandProbeResultUI.Probe()now decodes the fullxrayobject (version,state,errorMsg) from the remote status endpoint.UpdateHeartbeatpersists the two new fields.web/service/node_tree.go: Wired the xray state throughLocalDescendants()and the transitive node construction so chained/multi-hop topologies also benefit./probe/:idcontinue to treatstatusas panel API reachability (so "online" nodes remain eligible for updates/config even if their Xray is currently broken).Frontend
frontend/src/schemas/node.ts: AddedxrayState/xrayErrortoNodeRecordSchemaandProbeResultSchema.frontend/src/pages/nodes/NodeList.tsx:StatusDotnow renders a dedicated.xray-error-dot(purple) whenstatus === 'online'andxrayStateiserrororstop.StatusLabelshows "Online (Xray Error)" / "Online (stopped)" in matching purple.lastErrorstill uses warning color).frontend/src/pages/nodes/NodesPage.tsx: Manual "Probe now" now callsrefetch()so the row immediately reflects the fresh xray health.frontend/src/styles/utils.css: Added.xray-error-dot+ keyframe animation (modeled after the existing green.online-dot).web/translation/en-US.json: Added thexrayErrorstatus value key (with runtime fallback for other locales).statussemantics are unchanged for all existing call sites (update eligibility, totals, inbound node tags, etc.). Only the visual treatment in the Nodes list gained the extra dimension.How to test
!icon should appear; hovering it shows the error message that came from the node's own server status (e.g. the xray startup stderr or "xray is not running").Checklist (per CONTRIBUTING.md)
origin/old)go build ./...— attempted in the environment (toolchain version mismatch in the agent shell; will pass on a normal dev machine with Go 1.26.4+)cd frontend && npm run typecheck && npm run lint && npm run test && npm run build(user should run before merging)<area>: imperative summarystyle//comments in Go/TS per project convention (only the necessary explanatory ones in model)Screenshots / Demo
(Attach screenshots of the Nodes table showing the three states side-by-side, plus the tooltip with a real Xray error.)
Notes for the maintainer
Closes: (link any related issue if one was opened)
Full diff summary (for reviewer convenience)
(Everything else is noise from the worktree snapshot and should be ignored.)