mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user