refac
This commit is contained in:
@@ -1014,7 +1014,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
tools.set(await getTools(localStorage.token));
|
tools.set(await getTools(localStorage.token));
|
||||||
}
|
};
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@@ -1031,7 +1031,7 @@
|
|||||||
dropzoneElement.removeEventListener('drop', onDrop);
|
dropzoneElement.removeEventListener('drop', onDrop);
|
||||||
dropzoneElement.removeEventListener('dragleave', onDragLeave);
|
dropzoneElement.removeEventListener('dragleave', onDragLeave);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -1809,7 +1809,9 @@
|
|||||||
|
|
||||||
{#if (!history?.currentId || history.messages[history.currentId]?.done == true) && ($_user?.role === 'admin' || ($_user?.permissions?.chat?.stt ?? true))}
|
{#if (!history?.currentId || history.messages[history.currentId]?.done == true) && ($_user?.role === 'admin' || ($_user?.permissions?.chat?.stt ?? true))}
|
||||||
<!-- Terminal Server Selector -->
|
<!-- Terminal Server Selector -->
|
||||||
|
{#if ($terminalServers ?? []).length > 0 || ($settings?.terminalServers ?? []).some((s) => s.url)}
|
||||||
<TerminalMenu bind:show={showTerminalMenu} />
|
<TerminalMenu bind:show={showTerminalMenu} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
<!-- {$i18n.t('Record voice')} -->
|
<!-- {$i18n.t('Record voice')} -->
|
||||||
<Tooltip content={$i18n.t('Dictate')}>
|
<Tooltip content={$i18n.t('Dictate')}>
|
||||||
|
|||||||
@@ -84,21 +84,29 @@
|
|||||||
$: selectedDirectTerminal = directTerminals.find((t) => t.url === $selectedTerminalId);
|
$: selectedDirectTerminal = directTerminals.find((t) => t.url === $selectedTerminalId);
|
||||||
|
|
||||||
$: selectedLabel =
|
$: selectedLabel =
|
||||||
selectedSystemTerminal?.name ??
|
selectedSystemTerminal?.name ||
|
||||||
selectedDirectTerminal?.name ??
|
selectedSystemTerminal?.id ||
|
||||||
selectedDirectTerminal?.url?.replace(/^https?:\/\//, '') ??
|
selectedDirectTerminal?.name ||
|
||||||
null;
|
selectedDirectTerminal?.url?.replace(/^https?:\/\//, '') ||
|
||||||
|
$i18n.t('Terminal');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Dropdown bind:show>
|
<div class="flex items-center translate-x-0.5">
|
||||||
|
<Dropdown bind:show>
|
||||||
<Tooltip content={$i18n.t('Terminal')} placement="top">
|
<Tooltip content={$i18n.t('Terminal')} placement="top">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="flex items-center gap-1.5 px-2 py-1.5 text-sm transition rounded-lg cursor-pointer"
|
class="flex items-center gap-1.5 translate-y-[1px] hover:bg-gray-50 dark:hover:bg-gray-850 text-sm transition rounded-lg cursor-pointer {$selectedTerminalId &&
|
||||||
|
selectedLabel
|
||||||
|
? ' px-2.5 py-1 '
|
||||||
|
: ' p-2 opacity-50'}"
|
||||||
>
|
>
|
||||||
<Cloud className="size-3.5" strokeWidth="2" />
|
<Cloud className="size-3.5" strokeWidth="2" />
|
||||||
|
|
||||||
{#if $selectedTerminalId && selectedLabel}
|
{#if $selectedTerminalId && selectedLabel}
|
||||||
<span class="truncate text-xs max-w-[100px] sm:max-w-[150px]">{selectedLabel}</span>
|
<span class="truncate text-[13px] max-w-[100px] sm:max-w-[150px] capitalize"
|
||||||
|
>{selectedLabel}</span
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -248,4 +256,5 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user