From 40ddd172e0312aaa8e327d6c7e05c927bc95dfe2 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 26 Feb 2025 15:56:45 -0800 Subject: [PATCH] refac: web search settings ui --- .../admin/Settings/WebSearch.svelte | 633 +++++++++--------- 1 file changed, 324 insertions(+), 309 deletions(-) diff --git a/src/lib/components/admin/Settings/WebSearch.svelte b/src/lib/components/admin/Settings/WebSearch.svelte index 906530e5a..b7bd071f0 100644 --- a/src/lib/components/admin/Settings/WebSearch.svelte +++ b/src/lib/components/admin/Settings/WebSearch.svelte @@ -85,401 +85,416 @@ >
{#if webConfig} -
-
- {$i18n.t('Web Search')} -
+
+
+
{$i18n.t('General')}
-
-
+
+ +
- {$i18n.t('Enable Web Search')} + {$i18n.t('Web Search')} +
+
+
- -
-
-
-
{$i18n.t('Web Search Engine')}
-
- +
+
+ {$i18n.t('Web Search Engine')} +
+
+ +
-
-
-
- - {$i18n.t('Bypass Embedding and Retrieval')} - -
-
- - - -
-
- -
-
{$i18n.t('Trust Proxy Environment')}
-
- - - -
-
- - {#if webConfig.search.engine !== ''} -
+ {#if webConfig.search.engine !== ''} {#if webConfig.search.engine === 'searxng'} -
-
- {$i18n.t('Searxng Query URL')} -
+
+
+
+ {$i18n.t('Searxng Query URL')} +
-
-
- +
+
+ +
{:else if webConfig.search.engine === 'google_pse'} -
-
- {$i18n.t('Google PSE API Key')} -
+
+
+
+ {$i18n.t('Google PSE API Key')} +
- -
-
-
- {$i18n.t('Google PSE Engine Id')} +
+
+
+ {$i18n.t('Google PSE Engine Id')} +
-
-
- +
+
+ +
{:else if webConfig.search.engine === 'brave'} -
-
- {$i18n.t('Brave Search API Key')} -
+
+
+
+ {$i18n.t('Brave Search API Key')} +
- + +
{:else if webConfig.search.engine === 'kagi'} -
-
- {$i18n.t('Kagi Search API Key')} -
+
+
+
+ {$i18n.t('Kagi Search API Key')} +
- + +
+ .
{:else if webConfig.search.engine === 'mojeek'} -
-
- {$i18n.t('Mojeek Search API Key')} -
+
+
+
+ {$i18n.t('Mojeek Search API Key')} +
- + +
{:else if webConfig.search.engine === 'bocha'} -
-
- {$i18n.t('Bocha Search API Key')} -
+
+
+
+ {$i18n.t('Bocha Search API Key')} +
- + +
{:else if webConfig.search.engine === 'serpstack'} -
-
- {$i18n.t('Serpstack API Key')} -
+
+
+
+ {$i18n.t('Serpstack API Key')} +
- + +
{:else if webConfig.search.engine === 'serper'} -
-
- {$i18n.t('Serper API Key')} -
+
+
+
+ {$i18n.t('Serper API Key')} +
- + +
{:else if webConfig.search.engine === 'serply'} -
-
- {$i18n.t('Serply API Key')} -
+
+
+
+ {$i18n.t('Serply API Key')} +
- + +
{:else if webConfig.search.engine === 'searchapi'} -
-
- {$i18n.t('SearchApi API Key')} -
+
+
+
+ {$i18n.t('SearchApi API Key')} +
- -
-
-
- {$i18n.t('SearchApi Engine')} +
+
+
+ {$i18n.t('SearchApi Engine')} +
-
-
- +
+
+ +
{:else if webConfig.search.engine === 'serpapi'} -
-
- {$i18n.t('SerpApi API Key')} -
+
+
+
+ {$i18n.t('SerpApi API Key')} +
- -
-
-
- {$i18n.t('SerpApi Engine')} +
+
+
+ {$i18n.t('SerpApi Engine')} +
-
-
- +
+
+ +
{:else if webConfig.search.engine === 'tavily'} -
-
- {$i18n.t('Tavily API Key')} -
+
+
+
+ {$i18n.t('Tavily API Key')} +
- + +
{:else if webConfig.search.engine === 'jina'} -
-
- {$i18n.t('Jina API Key')} -
+
+
+
+ {$i18n.t('Jina API Key')} +
- + +
{:else if webConfig.search.engine === 'exa'} -
-
- {$i18n.t('Exa API Key')} -
+
+
+
+ {$i18n.t('Exa API Key')} +
- + +
{:else if webConfig.search.engine === 'bing'} -
-
- {$i18n.t('Bing Search V7 Endpoint')} -
+
+
+
+ {$i18n.t('Bing Search V7 Endpoint')} +
-
-
- +
+
+ +
-
-
-
- {$i18n.t('Bing Search V7 Subscription Key')} +
+
+ {$i18n.t('Bing Search V7 Subscription Key')} +
+ +
- -
{/if} -
- {/if} + {/if} - {#if webConfig.search.enabled} -
-
-
- {$i18n.t('Search Result Count')} + {#if webConfig.search.enabled} +
+
+
+
+ {$i18n.t('Search Result Count')} +
+ + +
+ +
+
+ {$i18n.t('Concurrent Requests')} +
+ + +
+
+
+ +
+
+ {$i18n.t('Domain Filter List')}
+ {/if} -
-
- {$i18n.t('Concurrent Requests')} -
- - +
+
+ + {$i18n.t('Bypass Embedding and Retrieval')} + +
+
+ + +
-
-
- {$i18n.t('Domain Filter List')} +
+
+ {$i18n.t('Trust Proxy Environment')} +
+
+ + +
- -
- {/if} -
- -
- -
-
- {$i18n.t('Web Loader Settings')}
-
-
+
+
{$i18n.t('Loader')}
+ +
+ +
{$i18n.t('Bypass SSL verification for Websites')}
- - +
+ +
-
-
- {$i18n.t('Youtube Loader Settings')} -
- -
-
-
{$i18n.t('Language')}
-
+
+
+ {$i18n.t('Youtube Language')} +
+
-
-
-
-
{$i18n.t('Proxy URL')}
-
+
+
+ {$i18n.t('Youtube Proxy URL')} +
+