Parcourir la source

refac: external tool server view

Timothy Jaeryang Baek il y a 4 mois
Parent
commit
9b4f032660

+ 1 - 1
src/lib/components/admin/Settings/Tools.svelte

@@ -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}

+ 12 - 25
src/lib/components/chat/Settings/Tools/Connection.svelte

@@ -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>