mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 00:30:51 +00:00
refac
This commit is contained in:
parent
b2928975dc
commit
3b4ee0f127
@ -58,10 +58,15 @@
|
|||||||
{#if Object.keys(tools).length > 0}
|
{#if Object.keys(tools).length > 0}
|
||||||
<div class=" max-h-28 overflow-y-auto scrollbar-hidden">
|
<div class=" max-h-28 overflow-y-auto scrollbar-hidden">
|
||||||
{#each Object.keys(tools) as toolId}
|
{#each Object.keys(tools) as toolId}
|
||||||
<div
|
<button
|
||||||
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
class="flex w-full justify-between gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
||||||
|
on:click={() => {
|
||||||
|
selectedToolIds = tools[toolId].enabled
|
||||||
|
? selectedToolIds.filter((id) => id !== toolId)
|
||||||
|
: [...selectedToolIds, toolId];
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div class="flex-1">
|
<div class="flex-1 truncate">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={tools[toolId]?.description ?? ''}
|
content={tools[toolId]?.description ?? ''}
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
@ -69,19 +74,14 @@
|
|||||||
>
|
>
|
||||||
<WrenchSolid />
|
<WrenchSolid />
|
||||||
|
|
||||||
<div class=" line-clamp-1">{tools[toolId].name}</div>
|
<div class=" truncate">{tools[toolId].name}</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Switch
|
<div class=" shrink-0 flex-shrink-0">
|
||||||
bind:state={tools[toolId].enabled}
|
<Switch state={tools[toolId].enabled} />
|
||||||
on:change={(e) => {
|
|
||||||
selectedToolIds = e.detail
|
|
||||||
? [...selectedToolIds, toolId]
|
|
||||||
: selectedToolIds.filter((id) => id !== toolId);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
</button>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -89,16 +89,19 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $config?.features?.enable_web_search}
|
{#if $config?.features?.enable_web_search}
|
||||||
<div
|
<button
|
||||||
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
class="flex w-full justify-between gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
||||||
|
on:click={() => {
|
||||||
|
webSearchEnabled = !webSearchEnabled;
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div class="flex-1 flex items-center gap-2">
|
<div class="flex-1 flex items-center gap-2">
|
||||||
<GlobeAltSolid />
|
<GlobeAltSolid />
|
||||||
<div class=" line-clamp-1">{$i18n.t('Web Search')}</div>
|
<div class=" line-clamp-1">{$i18n.t('Web Search')}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Switch bind:state={webSearchEnabled} />
|
<Switch state={webSearchEnabled} />
|
||||||
</div>
|
</button>
|
||||||
|
|
||||||
<hr class="border-gray-100 dark:border-gray-800 my-1" />
|
<hr class="border-gray-100 dark:border-gray-800 my-1" />
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user