refac: external tool server view

This commit is contained in:
Timothy Jaeryang Baek 2025-10-05 23:35:04 -05:00
parent 53de48d2b3
commit 9b4f032660
2 changed files with 13 additions and 26 deletions

View file

@ -83,7 +83,7 @@
</Tooltip>
</div>
<div class="flex flex-col gap-1.5">
<div class="flex flex-col gap-1">
{#each servers as server, idx}
<Connection
bind:connection={server}

View file

@ -7,6 +7,7 @@
import Cog6 from '$lib/components/icons/Cog6.svelte';
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
import WrenchAlt from '$lib/components/icons/WrenchAlt.svelte';
export let onDelete = () => {};
export let onSubmit = () => {};
@ -41,33 +42,19 @@
/>
<div class="flex w-full gap-2 items-center">
<Tooltip
className="w-full relative"
content={$i18n.t(`WebUI will make requests to "{{url}}"`, {
url: `${connection?.url}/${connection?.path ?? 'openapi.json'}`
})}
placement="top-start"
>
<Tooltip className="w-full relative" content={''} placement="top-start">
<div class="flex w-full">
<div class="flex-1 relative">
<input
class=" outline-hidden w-full bg-transparent {!(connection?.config?.enable ?? true)
? 'opacity-50'
: ''}"
placeholder={$i18n.t('API Base URL')}
bind:value={connection.url}
autocomplete="off"
/>
<div
class="flex-1 relative flex gap-1.5 items-center {!(connection?.config?.enable ?? true)
? 'opacity-50'
: ''}"
>
<WrenchAlt />
<div class=" capitalize outline-hidden w-full bg-transparent">
{connection?.info?.name ?? connection?.url}
<span class="text-gray-500">{connection?.info?.id}</span>
</div>
</div>
{#if (connection?.auth_type ?? 'bearer') === 'bearer'}
<SensitiveInput
inputClassName=" outline-hidden bg-transparent w-full"
placeholder={$i18n.t('API Key')}
bind:value={connection.key}
required={false}
/>
{/if}
</div>
</Tooltip>