refac
This commit is contained in:
1 parent
db9977926c
commit
37a9da50df
1 file changed
+11
-17
@@ -28,11 +28,7 @@
|
|||||||
dot: 'bg-green-500',
|
dot: 'bg-green-500',
|
||||||
pill: 'text-green-700 dark:text-green-300'
|
pill: 'text-green-700 dark:text-green-300'
|
||||||
}
|
}
|
||||||
: {
|
: null;
|
||||||
label: $i18n.t('No auth'),
|
|
||||||
dot: 'bg-gray-400',
|
|
||||||
pill: 'text-gray-500 dark:text-gray-400'
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal bind:show size="md">
|
<Modal bind:show size="md">
|
||||||
@@ -63,16 +59,24 @@
|
|||||||
{@const status = authStatus(tool)}
|
{@const status = authStatus(tool)}
|
||||||
{@const toolSpecs = tool?.specs ?? []}
|
{@const toolSpecs = tool?.specs ?? []}
|
||||||
<Collapsible
|
<Collapsible
|
||||||
buttonClassName="w-full mb-1 rounded-lg px-2 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
buttonClassName="w-full mb-1 rounded-lg px-2 py-1.5"
|
||||||
chevron={toolSpecs.length > 0}
|
chevron={toolSpecs.length > 0}
|
||||||
disabled={toolSpecs.length === 0}
|
disabled={toolSpecs.length === 0}
|
||||||
>
|
>
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<div class="flex items-center gap-2 min-w-0">
|
<div class="flex items-center gap-2 min-w-0">
|
||||||
<span class="size-2 rounded-full {status.dot}"></span>
|
|
||||||
<div class="text-sm font-medium dark:text-gray-100 text-gray-800 truncate">
|
<div class="text-sm font-medium dark:text-gray-100 text-gray-800 truncate">
|
||||||
{tool?.name}
|
{tool?.name}
|
||||||
</div>
|
</div>
|
||||||
|
{#if status}
|
||||||
|
<span class="size-2 rounded-full {status.dot} shrink-0"></span>
|
||||||
|
<span class="text-[11px] {status.pill} shrink-0">{status.label}</span>
|
||||||
|
{/if}
|
||||||
|
{#if toolSpecs.length > 0}
|
||||||
|
<span class="text-[11px] text-gray-500 dark:text-gray-400 shrink-0">
|
||||||
|
{toolSpecs.length}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if tool?.meta?.description}
|
{#if tool?.meta?.description}
|
||||||
@@ -82,16 +86,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ml-3 flex shrink-0 items-center gap-2 text-[11px]">
|
|
||||||
<span class="text-gray-500 dark:text-gray-400">{$i18n.t('Enabled')}</span>
|
|
||||||
<span class={status.pill}>{status.label}</span>
|
|
||||||
{#if toolSpecs.length > 0}
|
|
||||||
<span class="text-gray-500 dark:text-gray-400">
|
|
||||||
{$i18n.t('{{COUNT}} tools', { COUNT: toolSpecs.length })}
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div slot="content" class="pl-4 pr-2 pb-2 text-xs text-gray-500 dark:text-gray-400">
|
<div slot="content" class="pl-4 pr-2 pb-2 text-xs text-gray-500 dark:text-gray-400">
|
||||||
{#if toolSpecs.length > 0}
|
{#if toolSpecs.length > 0}
|
||||||
{#each toolSpecs as toolSpec}
|
{#each toolSpecs as toolSpec}
|
||||||
|
|||||||
Reference in new issue
Block a user