feat(nodes): add Veil core selector + badge to create/edit forms#344
Draft
Rxflex wants to merge 1 commit into
Draft
feat(nodes): add Veil core selector + badge to create/edit forms#344Rxflex wants to merge 1 commit into
Rxflex wants to merge 1 commit into
Conversation
Mirrors the panel-side change in remnawave/backend#168 and the node- side change in remnawave/node#38: lets operators choose XRAY (default) or VEIL when registering or editing a node. - New 'core' field on Create/Update node payloads (inline contract shim until @remnawave/backend-contract publishes a release with the upstream NodeCore enum). - Mantine Select on the create-node modal step 1 and on the NodeVitalsCard inside the edit drawer. - VeilLogo swaps in for XrayLogo on the node card whenever node.core === 'VEIL', so the fleet view shows what's actually running at a glance. - All existing XRAY-only flows are unchanged; defaults preserve byte-for-byte compatibility with today's payloads.
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.
Summary
Frontend counterpart to remnawave/node#38 and remnawave/backend#168 (both Draft). Adds a "Proxy core" selector —
XRAY(default) orVEIL— to the Create / Edit Node forms, ships aVeilLogoso the Veil-cored nodes are visually distinct on the dashboard, and threads the newcorefield through the Create / Update node payloads.What ships
Inline contract shim (
src/shared/api/contracts/veil-node.contract.ts) — extendsCreateNodeCommand.RequestSchema/UpdateNodeCommand.RequestSchemawith a typedcore: 'XRAY' | 'VEIL'field. Pure superset of the upstream schemas, so every existing XRAY-only payload still parses unchanged.Constants (
src/shared/constants/veil/) —NODE_CORE,TNodeCore,DEFAULT_NODE_CORE,NODE_CORE_LABELS. Single source of truth for both forms and the dashboard logo selector.Mutation hooks (
src/shared/api/hooks/nodes/nodes.mutation.hooks.ts) —useCreateNode/useUpdateNodenow use the Veil-aware request schemas as their bodySchema. No call-site changes for callers that don't passcore(zod default +optional()keep them happy).Create-node modal — step 1 grows a Mantine
Selectbetween the country picker and the address row. Defaults toXRAY. Step 2 + the modal widget itself just thread the wider form type.Edit-node modal —
NodeVitalsCardgrows the sameSelectright under the country picker. TheEditNodeByUuidModalContentreadscorefrom the fetched node row (with aXRAYfallback for the period before the backend column lands) and includes it in the update payload.VeilLogo(src/shared/ui/logos/veil-logo.tsx) — stylised "V"-on-a-shield SVG built to match the dimensions of the existingXrayLogo(35×35 viewBox,currentColorfill). Shows up in the node card's three uptime / version slots whenevernode.core === 'VEIL'.Why this shape
The upstream
Nodes.coreenum lives in the backend PR (#168) and the matching backend-contract package release isn't out yet. Two options:I went with (2) so this PR can sit Draft alongside the others and graduate to ready when all three repos are coherent.
The
coreselector lives inside the existingNodeVitalsCardrather than getting its own card. Operators already think of "what's running on this node" as part of node identity (alongside name / address / port / plugin), and the visual hierarchy stays flat.The node card swaps logo via a one-line
CoreLogoternary instead of branching on each render site. Three render sites, all passsizeandcolor, so the swap is mechanical.Backwards compat
Pure addition. Every node that the panel returns without a
corefield falls back toXRAYat form-init and at logo-resolve time. The Create and Update mutations sendcore: 'XRAY'by default; once the backend column lands every existing row already defaults toXRAYserver-side too. Operators who never touch the new selector see zero behavioural change.Test plan
The repo doesn't ship a frontend unit-test harness today (no
*.test.tsxundersrc/), so this PR adds none either. Manual verification I ran againstnpm run start:dev:npx tsc --noEmitclean.npx eslint --fixclean on every touched file (no remaining warnings)."core":"XRAY"(verified in DevTools Network tab against a panel running сhore: release v2.1.17 #168)."core":"VEIL". Backend (running сhore: release v2.1.17 #168) accepts; row appears in the dashboard with the new VeilLogo in the uptime slot and version chip.NodeVitalsCardreads the existing node's core and pre-fills the select. Switching XRAY ↔ VEIL and saving updates the row (verifiedSELECT core FROM nodesagainst the test panel's DB).coreselection touched → wire payload, DB row, and rendered card are byte-identical to today.Out-of-scope (follow-ups)
TFunctionoverload that requires a separate JSON-edit PR per locale; that's tracked for the same follow-up that adds Veil-specific copy./api/users; surfacing those in the panel's user-detail view is a follow-up that pairs with the backend-sideVeilUserSyncProcessor(also out-of-scope of сhore: release v2.1.17 #168).node-system-cardwill get a Veil-specific section; not in this PR because the upstream Veil schema isn't pinned yet.File map
Total: 14 files changed, +219 / −20.
Notes for reviewers
eslint --fix, Mantine 8 component props,motion/reactmotion variants.zod(already direct), the logo uses@mantine/core'sBox(already direct).veil-node.contract.tsfile documents the swap path: a single search-and-replace fromCreateVeilAwareNode*→CreateNode*once@remnawave/backend-contractships the upstreamNodeCore. The shim folder gets deleted in a one-line PR.node-card.widget.tsx:80-83andedit-node-by-uuid-modal.content.tsx:73-79is the only placeunknownis used — both isolated, both annotated, both go away when the upstream Nodes schema gainscore.