feat(dashboard): select optional Xray API services in both core editors#662
Open
Multi-Engineer-dev wants to merge 8 commits into
Open
feat(dashboard): select optional Xray API services in both core editors#662Multi-Engineer-dev wants to merge 8 commits into
Multi-Engineer-dev wants to merge 8 commits into
Conversation
Adds an "API" section to the route-based core editor (Nodes > Cores), mirroring the legacy core-config modal's control. Reuses the existing xray-api-services helpers; optional services are stored on the profile's preserved top-level `api` block and persisted through the xray adapter.
…ction Unchecking the last optional api service emptied raw.topLevel.api, so the adapter override disappeared and the kit re-emitted the original api from raw.source, leaving the persisted config unchanged (Save never enabled and the removal would not stick). setRawOptionalService now edits raw.source and raw.topLevel in lockstep so toggles round-trip cleanly. The API section header rendered the raw i18n key whenever a stale (service-worker cached) locale bundle lacked the new keys. PageHeader now accepts title/description defaults, matching the codebase's defaultValue pattern, so the header reads correctly regardless of cache state.
The structured core editor's API section was only partly localized: - coreEditor.section.api / sectionDesc.api existed in en.json only, so fa/ru/zh fell back to English for the section header. - coreEditor.api.title / api.hint (the section card title and hint) were inline English defaultValues, absent from every locale file. Add the section header keys to fa/ru/zh and the card title + hint to all four locales (the "API" acronym is kept; descriptive text translated).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
Adds first-class support for selecting optional Xray gRPC API services from
the dashboard, in both core-config editors, plus the supporting validation,
persistence, and localization.
Why
Xray exposes optional API services (e.g.
RoutingService,ObservatoryService)beyond the always-on
HandlerService/LoggerService/StatsService.Operators previously had to hand-edit raw JSON to enable them. This adds a
guided, validated control and ensures the selection round-trips correctly
through the structured editor.
What's included
lib/xray-api-services.ts): canonical required andoptional service lists mirrored from xray-core, with pure helpers to read and
toggle the selected optional services. Unit tests pin the allowlist so it
can't drift silently.
services, with blocking validation that rejects unknown names and de-dupes
them, plus accessible label/checkbox associations.
the default route-based editor.
(title + hint) are translated across all four locales (en/fa/ru/zh); the
"API" acronym is kept as-is.
adapter re-emits
apifromraw.source, so toggles now updateraw.sourceand
raw.topLevelin lockstep (setRawOptionalService) — otherwise removingthe last optional service produced no diff and left Save disabled.
locale is served, via
defaultValuefallbacks onPageHeader.Tests
toggle-persistence fix.
esbuildintegration check against a real core config, lints, and aproduction build all pass.
Related
Dashboard half of the Xray API services feature. The backend that merges these
user-selected services with the node's required services (instead of
overwriting them) lives in Node PR 60.