From 7cc41d83cf329903acdcb2e2f0df0fd0f4c84134 Mon Sep 17 00:00:00 2001 From: zoyopei Date: Sun, 24 Aug 2025 19:52:14 +0800 Subject: [PATCH] fix(ui): add CUSTOM_ROUTER_PATH support in general settings - Add CUSTOM_ROUTER_PATH field to UI configuration - Fix configuration preservation during save operations --- ui/src/components/ConfigProvider.tsx | 6 ++++-- ui/src/components/SettingsDialog.tsx | 15 +++++++++++++++ ui/src/locales/en.json | 4 +++- ui/src/locales/zh.json | 4 +++- ui/src/types.ts | 1 + 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ui/src/components/ConfigProvider.tsx b/ui/src/components/ConfigProvider.tsx index d6c01df..1cec10d 100644 --- a/ui/src/components/ConfigProvider.tsx +++ b/ui/src/components/ConfigProvider.tsx @@ -103,7 +103,8 @@ export function ConfigProvider({ children }: ConfigProviderProps) { longContext: '', longContextThreshold: 60000, webSearch: '' - } + }, + CUSTOM_ROUTER_PATH: typeof data.CUSTOM_ROUTER_PATH === 'string' ? data.CUSTOM_ROUTER_PATH : '' }; setConfig(validConfig); @@ -132,7 +133,8 @@ export function ConfigProvider({ children }: ConfigProviderProps) { longContext: '', longContextThreshold: 60000, webSearch: '' - } + }, + CUSTOM_ROUTER_PATH: '' }); setError(err as Error); } diff --git a/ui/src/components/SettingsDialog.tsx b/ui/src/components/SettingsDialog.tsx index c29ce8a..712c349 100644 --- a/ui/src/components/SettingsDialog.tsx +++ b/ui/src/components/SettingsDialog.tsx @@ -212,6 +212,21 @@ export function SettingsDialog({ isOpen, onOpenChange }: SettingsDialogProps) { className="transition-all-ease focus:scale-[1.01]" /> +
+ + setConfig({ ...config, CUSTOM_ROUTER_PATH: e.target.value })} + placeholder={t("toplevel.custom_router_path_placeholder")} + className="transition-all-ease focus:scale-[1.01]" + /> +