refactor(web): load channel configs without exposing secret values (#2277)

* refactor(web): load channel configs without exposing secret values

- add a dedicated channel config API that returns sanitized config plus
  configured secret metadata
- update channel config pages and forms to use secret presence for
  placeholders, validation, reset, and save behavior
- refresh the channel settings layout and clean up related i18n copy
- add backend tests for the new channel config endpoint

* fix(config): restore missing strings import
This commit is contained in:
wenjie
2026-04-02 19:09:33 +08:00
committed by GitHub
parent e075be6b10
commit dad5dcc30f
16 changed files with 1232 additions and 809 deletions
+15 -2
View File
@@ -1,5 +1,3 @@
// API client for channels navigation and channel-specific config flows.
import { launcherFetch } from "@/api/http"
export type ChannelConfig = Record<string, unknown>
@@ -12,6 +10,13 @@ export interface SupportedChannel {
variant?: string
}
export interface ChannelConfigResponse {
config: ChannelConfig
configured_secrets: string[]
config_key: string
variant?: string
}
interface ChannelsCatalogResponse {
channels: SupportedChannel[]
}
@@ -54,6 +59,14 @@ export async function getAppConfig(): Promise<AppConfig> {
return request<AppConfig>("/api/config")
}
export async function getChannelConfig(
channelName: string,
): Promise<ChannelConfigResponse> {
return request<ChannelConfigResponse>(
`/api/channels/${encodeURIComponent(channelName)}/config`,
)
}
export async function patchAppConfig(
patch: Record<string, unknown>,
): Promise<ConfigActionResponse> {