Repository navigation
Conversation
…node routing Three multi-node panel features: 1. Configurable inbound display order (Settings -> General): new inboundListOrder setting (id, remark, port, protocol, subSortIndex), applied server-side to the inbound list endpoints so it covers local and node-adopted inbounds alike; subSortIndex gives a manual per-inbound order through the existing form field. 2. Safe inbound ID (tag) change: per-row 'Change ID' action with a live pre-flight check reporting tag uniqueness, node-side conflicts and how many routing rules a rename would rewrite; the rename rewrites routing rules and loopback outbounds referencing the old tag, re-pushes node-hosted inbounds and flags an xray restart when routing changed. 3. Centralized node routing control (new Node Routing page): shared routing policy (JSON array of Xray routing rules) with an enable gate, pushable to selected nodes or all online nodes and clearable per node; nodes store the policy (survives restarts) and apply it ahead of their own rules, keeping the pinned api stats rule first; the master mirrors each node's active policy on its row. Regenerated openapi/zod artifacts and the docs API reference for the new endpoints (checkTag, changeTag, routing/apply, routing/control).
changeTag previously reported every failure (bad id, bind error, failed rename) under the 'inboundUpdateSuccess' toast, so a failed rename read as success. Use 'somethingWentWrong' for the error paths, matching updateInbound; keep 'inboundUpdateSuccess' only for the success response. Same fix for checkTag's bind error (was 'get').
|
@MHSanaei Hi! This PR implements three multi-node panel features (configurable inbound display order, safe inbound ID change, and centralized node routing control) along with a small toast-label fix. All Go tests, golangci-lint (0 issues), and frontend typecheck/build/Storybook pass. Could you please review when you have time? Thank you! |
|
Feature verdict: Fits with gaps. This PR adds three things for operators who run a master panel with nodes. First, a General setting that picks the order of the inbound list (id, remark, port, protocol or manual sub-sort index). Second, a per-row "Change ID" action that checks a new inbound tag before renaming it. Third, a Node Routing page that pushes one shared set of Xray routing rules to chosen nodes, ahead of each node's own rules. The list order and the rename both reuse paths the panel already trusts, and they hold up. The node routing push has two gaps. A policy that the node's Xray rejects is still reported as "applied", and it stays stored on the node, which can leave that node's Xray unable to start. And a rule the operator marked No blocking issues — 0 HIGH / 2 MEDIUM / 3 LOW open (5 new), 0 pre-existing Reviewed head: bdb9390 Evidence. List order: the setting is checked against a fixed list and mapped to a fixed ORDER BY in Design. The policy is written on the master. There, node-hosted inbounds carry the MEDIUM — a policy the node's Xray rejects is reported as applied and persists across restarts — MEDIUM — policy rules marked LOW — the LOW — the "Node routing control" switch is enforced only in the browser — LOW — comment blocks over the two-line limit — Coverage (head bdb9390; 50 files, about +2.4k/−60, including 14 locale files and generated artefacts)
|
Address two MEDIUM findings from the automated review: - mergeMasterRoutingRules now drops policy rules explicitly marked enabled:false, matching stripDisabledRules behaviour for the node's own rules (previously the enabled key was deleted and the rule kept live). Updated the inbound_features_test assertion to expect the disabled rule dropped. - node-side routingControl now returns an error (and reverts to the previously stored policy) when RestartXray fails, instead of logging and reporting success. ApplyRoutingControl already keys Applied off the push result, so the master no longer mirrors a policy the node cannot apply. Also add an aria-label to the node-routing control Switch (accessibility).
|
Addressed the two MEDIUM findings from the automated review in commit aa900ab:
Also added an @MHSanaei please review when you have time. Thank you! |
routingControl now returns an error (and reverts to the previously stored policy) only when Xray is actually running and rejects the resulting config. When Xray is stopped the policy is stored and reported as applied, since it takes effect on the next start. This keeps the node contract test working in environments without a running Xray while still surfacing genuine rejections.
Wrap setState calls in setTimeout to satisfy react-hooks/set-state-in-effect. Also add aria-label to the node-routing control Switch.
This PR adds three multi-node panel features:
Also fixed a toast-label bug where failed inbound ID changes were reported as success.
@MHSanaei please review when you have time.