mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-19 13:09:08 +08:00
refac: input menu tools
This commit is contained in:
parent
0bb26ae504
commit
db3b075796
@ -46,28 +46,31 @@
|
|||||||
transition={flyAndScale}
|
transition={flyAndScale}
|
||||||
>
|
>
|
||||||
{#if Object.keys(tools).length > 0}
|
{#if Object.keys(tools).length > 0}
|
||||||
{#each Object.keys(tools) as toolId}
|
<div class=" max-h-28 overflow-y-auto scrollbar-hidden">
|
||||||
<div
|
{#each Object.keys(tools) as toolId}
|
||||||
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
<div
|
||||||
>
|
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
||||||
<div class="flex-1 flex items-center gap-2">
|
>
|
||||||
<WrenchSolid />
|
<div class="flex-1 flex items-center gap-2">
|
||||||
|
<WrenchSolid />
|
||||||
|
|
||||||
<Tooltip content={tools[toolId]?.description ?? ''}>
|
<Tooltip content={tools[toolId]?.description ?? ''}>
|
||||||
<div class="flex items-center line-clamp-1">{tools[toolId].name}</div>
|
<div class="flex items-center line-clamp-1">{tools[toolId].name}</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
bind:state={tools[toolId].enabled}
|
||||||
|
on:change={(e) => {
|
||||||
|
selectedToolIds = e.detail
|
||||||
|
? [...selectedToolIds, toolId]
|
||||||
|
: selectedToolIds.filter((id) => id !== toolId);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
<Switch
|
|
||||||
bind:state={tools[toolId].enabled}
|
|
||||||
on:change={(e) => {
|
|
||||||
selectedToolIds = e.detail
|
|
||||||
? [...selectedToolIds, toolId]
|
|
||||||
: selectedToolIds.filter((id) => id !== toolId);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
<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…
x
Reference in New Issue
Block a user