From 3ac935f0471153efaa4dc28b8a31f1f1065777a1 Mon Sep 17 00:00:00 2001 From: erio Date: Sun, 12 Apr 2026 15:59:45 +0800 Subject: [PATCH] fix(websearch): improve settings UI and hide config when globally disabled - API Key show/copy buttons moved inside input field (inline icons) - Proxy selector and test button on same row to save vertical space - Test opens a dialog modal instead of inline display - Hide all websearch config in channels/accounts when global toggle is off --- backend/cmd/server/VERSION | 2 +- .../components/account/CreateAccountModal.vue | 10 +- .../components/account/EditAccountModal.vue | 10 +- frontend/src/views/admin/ChannelsView.vue | 11 +- frontend/src/views/admin/SettingsView.vue | 155 ++++++++++-------- 5 files changed, 112 insertions(+), 76 deletions(-) diff --git a/backend/cmd/server/VERSION b/backend/cmd/server/VERSION index a758d60ed3..061bed0b17 100644 --- a/backend/cmd/server/VERSION +++ b/backend/cmd/server/VERSION @@ -1 +1 @@ -0.1.110.10 +0.1.110.11 diff --git a/frontend/src/components/account/CreateAccountModal.vue b/frontend/src/components/account/CreateAccountModal.vue index ec6d62faaa..9af33aa52f 100644 --- a/frontend/src/components/account/CreateAccountModal.vue +++ b/frontend/src/components/account/CreateAccountModal.vue @@ -2361,9 +2361,9 @@ - +
@@ -3034,6 +3034,12 @@ const openaiAPIKeyResponsesWebSocketV2Mode = ref(OPENAI_WS_MODE_OF const codexCLIOnlyEnabled = ref(false) const anthropicPassthroughEnabled = ref(false) const webSearchEmulationEnabled = ref(false) +const webSearchGlobalEnabled = ref(false) + +// Load web search global state once +adminAPI.settings.getWebSearchEmulationConfig().then(cfg => { + webSearchGlobalEnabled.value = cfg?.enabled === true && (cfg?.providers?.length ?? 0) > 0 +}).catch(() => { webSearchGlobalEnabled.value = false }) const mixedScheduling = ref(false) // For antigravity accounts: enable mixed scheduling const allowOverages = ref(false) // For antigravity accounts: enable AI Credits overages const antigravityAccountType = ref<'oauth' | 'upstream'>('oauth') // For antigravity: oauth or upstream diff --git a/frontend/src/components/account/EditAccountModal.vue b/frontend/src/components/account/EditAccountModal.vue index 54dae5c28e..086575e65a 100644 --- a/frontend/src/components/account/EditAccountModal.vue +++ b/frontend/src/components/account/EditAccountModal.vue @@ -1149,9 +1149,9 @@
- +
@@ -1975,6 +1975,12 @@ const openaiAPIKeyResponsesWebSocketV2Mode = ref(OPENAI_WS_MODE_OF const codexCLIOnlyEnabled = ref(false) const anthropicPassthroughEnabled = ref(false) const webSearchEmulationEnabled = ref(false) +const webSearchGlobalEnabled = ref(false) + +// Load web search global state once +adminAPI.settings.getWebSearchEmulationConfig().then(cfg => { + webSearchGlobalEnabled.value = cfg?.enabled === true && (cfg?.providers?.length ?? 0) > 0 +}).catch(() => { webSearchGlobalEnabled.value = false }) const editQuotaLimit = ref(null) const editQuotaDailyLimit = ref(null) const editQuotaWeeklyLimit = ref(null) diff --git a/frontend/src/views/admin/ChannelsView.vue b/frontend/src/views/admin/ChannelsView.vue index d19afd04f7..639ace4a85 100644 --- a/frontend/src/views/admin/ChannelsView.vue +++ b/frontend/src/views/admin/ChannelsView.vue @@ -306,21 +306,18 @@
- -
+ +
-

+

{{ t('admin.channels.form.webSearchEmulationHint') }}

-

- {{ t('admin.channels.form.webSearchEmulationGlobalDisabled') }} -

- +
diff --git a/frontend/src/views/admin/SettingsView.vue b/frontend/src/views/admin/SettingsView.vue index faab49feaf..b5181ccc5d 100644 --- a/frontend/src/views/admin/SettingsView.vue +++ b/frontend/src/views/admin/SettingsView.vue @@ -1789,40 +1789,42 @@
- +
-
+
- - +
+ + +
@@ -1858,44 +1860,19 @@ {{ provider.quota_used ?? 0 }} / {{ provider.quota_limit }}
- -
- - -
- - -
-
- - -
- -
-

- {{ t('admin.settings.webSearchEmulation.testResultProvider') }}: {{ wsTestResult.provider }} -

-
- {{ t('admin.settings.webSearchEmulation.testNoResults') }} -
-
- {{ r.title }} -

{{ r.snippet && r.snippet.length > 120 ? r.snippet.slice(0, 120) + '...' : r.snippet }}

-
+ +
+
+ +
+
@@ -1903,6 +1880,50 @@
+ +
+
+

+ {{ t('admin.settings.webSearchEmulation.testResultTitle') }} +

+
+ + +
+ +
+

+ {{ t('admin.settings.webSearchEmulation.testResultProvider') }}: {{ wsTestResult.provider }} +

+
+ {{ t('admin.settings.webSearchEmulation.testNoResults') }} +
+
+ {{ r.title }} +

{{ r.snippet }}

+
+
+
+ +
+
+
+ @@ -3016,6 +3037,12 @@ const apiKeyVisible = reactive>({}) const wsTestQuery = ref('') const wsTestLoading = ref(false) const wsTestResult = ref(null) +const wsTestDialogOpen = ref(false) + +function openTestDialog() { + wsTestResult.value = null + wsTestDialogOpen.value = true +} function toggleProviderExpand(idx: number) { expandedProviders[idx] = !expandedProviders[idx]