This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-14 01:40:58 -04:00
1 parent 6e14d0d627
commit b012d683d8
18 files changed
+107 -102

No files matched your search

@@ -20,7 +20,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="min-w-[150px]"> <DropdownMenu className="min-w-[150px]">
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
dispatch('delete'); dispatch('delete');
show = false; show = false;
@@ -243,7 +243,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="w-[170px]"> <DropdownMenu className="w-[170px]">
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => exportHandler('json')} on:click={() => exportHandler('json')}
> >
@@ -251,7 +251,7 @@
</button> </button>
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => exportHandler('csv')} on:click={() => exportHandler('csv')}
> >
@@ -33,7 +33,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="min-w-[190px]"> <DropdownMenu className="min-w-[190px]">
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={async () => { on:click={async () => {
createHandler(); createHandler();
show = false; show = false;
@@ -46,7 +46,7 @@
</button> </button>
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={async () => { on:click={async () => {
importFromLinkHandler(); importFromLinkHandler();
show = false; show = false;
@@ -43,7 +43,7 @@
<DropdownMenu className="min-w-[180px]"> <DropdownMenu className="min-w-[180px]">
{#if ['filter', 'action'].includes(func.type)} {#if ['filter', 'action'].includes(func.type)}
<div <div
class="flex gap-2 justify-between items-center px-3 py-1.5 text-sm font-medium cursor-pointerrounded-md" class="flex gap-2 justify-between items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer rounded-xl"
> >
<div class="flex gap-2 items-center"> <div class="flex gap-2 items-center">
<GlobeAlt /> <GlobeAlt />
@@ -59,7 +59,7 @@
{/if} {/if}
<button <button
class="select-none flex gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md w-full" class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"
on:click={() => { on:click={() => {
editHandler(); editHandler();
}} }}
@@ -70,7 +70,7 @@
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="w-4 h-4" class="size-3.5"
> >
<path <path
stroke-linecap="round" stroke-linecap="round"
@@ -83,7 +83,7 @@
</button> </button>
<button <button
class="select-none flex gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md w-full" class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"
on:click={() => { on:click={() => {
shareHandler(); shareHandler();
}} }}
@@ -93,7 +93,7 @@
</button> </button>
<button <button
class="select-none flex gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md w-full" class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"
on:click={() => { on:click={() => {
cloneHandler(); cloneHandler();
}} }}
@@ -103,7 +103,7 @@
</button> </button>
<button <button
class="select-none flex gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md w-full" class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"
on:click={() => { on:click={() => {
exportHandler(); exportHandler();
}} }}
@@ -115,7 +115,7 @@
<hr class="border-gray-50 dark:border-gray-850/30 my-1" /> <hr class="border-gray-50 dark:border-gray-850/30 my-1" />
<button <button
class="select-none flex gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md w-full" class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"
on:click={() => { on:click={() => {
deleteHandler(); deleteHandler();
}} }}
+10 -10
View File
@@ -536,55 +536,55 @@
class="p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition" class="p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition"
type="button" type="button"
> >
<EllipsisHorizontal className="size-4" /> <EllipsisHorizontal className="size-3.5" />
</button> </button>
</Tooltip> </Tooltip>
<div slot="content"> <div slot="content">
<DropdownMenu className="w-[170px]"> <DropdownMenu className="w-[170px]">
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => { on:click={() => {
enableAllHandler(); enableAllHandler();
}} }}
> >
<CheckCircle className="size-4" /> <CheckCircle className="size-3.5" />
<div class="flex items-center">{$i18n.t('Enable All')}</div> <div class="flex items-center">{$i18n.t('Enable All')}</div>
</button> </button>
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => { on:click={() => {
disableAllHandler(); disableAllHandler();
}} }}
> >
<Minus className="size-4" /> <Minus className="size-3.5" />
<div class="flex items-center">{$i18n.t('Disable All')}</div> <div class="flex items-center">{$i18n.t('Disable All')}</div>
</button> </button>
<hr class="border-gray-100 dark:border-gray-800 my-1" /> <hr class="border-gray-100 dark:border-gray-800 my-1" />
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => { on:click={() => {
showAllHandler(); showAllHandler();
}} }}
> >
<Eye className="size-4" /> <Eye className="size-3.5" />
<div class="flex items-center">{$i18n.t('Show All')}</div> <div class="flex items-center">{$i18n.t('Show All')}</div>
</button> </button>
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
type="button" type="button"
on:click={() => { on:click={() => {
hideAllHandler(); hideAllHandler();
}} }}
> >
<EyeSlash className="size-4" /> <EyeSlash className="size-3.5" />
<div class="flex items-center">{$i18n.t('Hide All')}</div> <div class="flex items-center">{$i18n.t('Hide All')}</div>
</button> </button>
</DropdownMenu> </DropdownMenu>
@@ -707,7 +707,7 @@
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="w-4 h-4" class="size-3.5"
> >
<path <path
stroke-linecap="round" stroke-linecap="round"
@@ -49,7 +49,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="min-w-[170px]"> <DropdownMenu className="min-w-[170px]">
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
on:click={() => { on:click={() => {
hideHandler(); hideHandler();
}} }}
@@ -61,7 +61,7 @@
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="size-4" class="size-3.5"
> >
<path <path
stroke-linecap="round" stroke-linecap="round"
@@ -76,7 +76,7 @@
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="size-4" class="size-3.5"
> >
<path <path
stroke-linecap="round" stroke-linecap="round"
@@ -101,7 +101,7 @@
</button> </button>
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
on:click={() => { on:click={() => {
pinModelHandler(model?.id); pinModelHandler(model?.id);
}} }}
@@ -122,7 +122,7 @@
</button> </button>
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
on:click={() => { on:click={() => {
copyLinkHandler(); copyLinkHandler();
}} }}
@@ -134,7 +134,7 @@
{#if model?.is_active ?? true} {#if model?.is_active ?? true}
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
on:click={() => { on:click={() => {
cloneHandler(); cloneHandler();
}} }}
@@ -146,7 +146,7 @@
{/if} {/if}
<button <button
class="select-none flex w-full gap-2 items-center px-3 py-1.5 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md" class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
on:click={() => { on:click={() => {
exportHandler(); exportHandler();
}} }}
@@ -46,7 +46,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="w-[200px] z-999 transition"> <DropdownMenu className="w-[200px] z-999 transition">
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
type="button" type="button"
on:click={() => { on:click={() => {
uploadFilesHandler(); uploadFilesHandler();
@@ -58,7 +58,7 @@
</button> </button>
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
type="button" type="button"
on:click={() => { on:click={() => {
screenCaptureHandler(); screenCaptureHandler();
@@ -308,7 +308,7 @@
<DropdownMenu className="min-w-[150px] z-[9999999]"> <DropdownMenu className="min-w-[150px] z-[9999999]">
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
const path = const path =
@@ -336,7 +336,7 @@
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
const path = const path =
@@ -354,7 +354,7 @@
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
startRename(); startRename();
@@ -366,7 +366,7 @@
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
onDelete(`${currentPath}${entry.name}`, entry.name); onDelete(`${currentPath}${entry.name}`, entry.name);
@@ -191,7 +191,7 @@
<DropdownMenu className="min-w-[150px] z-[9999999]"> <DropdownMenu className="min-w-[150px] z-[9999999]">
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={() => onSort('name')} on:click={() => onSort('name')}
> >
<span class="flex-1 text-left">{$i18n.t('Name')}</span> <span class="flex-1 text-left">{$i18n.t('Name')}</span>
@@ -214,7 +214,7 @@
</button> </button>
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={() => onSort('date')} on:click={() => onSort('date')}
> >
<span class="flex-1 text-left">{$i18n.t('Date Modified')}</span> <span class="flex-1 text-left">{$i18n.t('Date Modified')}</span>
@@ -29,7 +29,7 @@
<DropdownMenu className="min-w-[180px] z-[9999] dark:bg-gray-900 shadow-xs"> <DropdownMenu className="min-w-[180px] z-[9999] dark:bg-gray-900 shadow-xs">
{#each devices as device} {#each devices as device}
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
dispatch('change', device.deviceId); dispatch('change', device.deviceId);
}} }}
@@ -73,7 +73,7 @@
</div> </div>
<hr class="border-gray-50/30 dark:border-gray-800/30 my-0.5 mx-1" /> <hr class="border-gray-50/30 dark:border-gray-800/30 my-0.5 mx-1" />
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onRegenerate(); onRegenerate();
show = false; show = false;
@@ -98,7 +98,7 @@
</button> </button>
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onRegenerate($i18n.t('Add Details')); onRegenerate($i18n.t('Add Details'));
}} }}
@@ -108,7 +108,7 @@
</button> </button>
<button <button
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onRegenerate($i18n.t('More Concise')); onRegenerate($i18n.t('More Concise'));
}} }}
@@ -48,7 +48,7 @@
{#if model?.preset || model?.info?.base_model_id ? model?.info?.user_id === $user?.id : $user?.role === 'admin'} {#if model?.preset || model?.info?.base_model_id ? model?.info?.user_id === $user?.id : $user?.role === 'admin'}
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -69,7 +69,7 @@
{#if $user?.role === 'admin' && model?.owned_by === 'ollama'} {#if $user?.role === 'admin' && model?.owned_by === 'ollama'}
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -103,7 +103,7 @@
<button <button
type="button" type="button"
aria-pressed={($settings?.pinnedModels ?? []).includes(model?.id)} aria-pressed={($settings?.pinnedModels ?? []).includes(model?.id)}
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -129,7 +129,7 @@
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -148,7 +148,7 @@
<button <button
type="button" type="button"
class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition" class="select-none flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
on:click={(e) => { on:click={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
+14 -14
View File
@@ -292,7 +292,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="select-none min-w-[200px] max-w-[200px] transition"> <DropdownMenu className="select-none min-w-[200px] max-w-[200px] transition">
<!-- <DropdownMenu.Item draggable="false" <!-- <DropdownMenu.Item draggable="false"
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer dark:hover:bg-gray-800 rounded-xl" class="flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer dark:hover:bg-gray-800 rounded-xl"
on:click={async () => { on:click={async () => {
await showSettings.set(!$showSettings); await showSettings.set(!$showSettings);
}} }}
@@ -303,7 +303,7 @@
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="size-4" class="size-3.5"
> >
<path <path
stroke-linecap="round" stroke-linecap="round"
@@ -323,7 +323,7 @@
{#if scrollToTop} {#if scrollToTop}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
scrollToTop(); scrollToTop();
}} }}
@@ -351,7 +351,7 @@
{#if ($artifactContents ?? []).length > 0} {#if ($artifactContents ?? []).length > 0}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
id="chat-artifacts-button" id="chat-artifacts-button"
on:click={async () => { on:click={async () => {
await showControls.set(true); await showControls.set(true);
@@ -369,7 +369,7 @@
{#if !readOnly && !$temporaryChatEnabled && ($user?.role === 'admin' || ($user.permissions?.chat?.share ?? true))} {#if !readOnly && !$temporaryChatEnabled && ($user?.role === 'admin' || ($user.permissions?.chat?.share ?? true))}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
id="chat-share-button" id="chat-share-button"
on:click={() => { on:click={() => {
shareHandler(); shareHandler();
@@ -385,7 +385,7 @@
<button <button
slot="trigger" slot="trigger"
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
> >
<Download className="size-3.5" strokeWidth="1.5" /> <Download className="size-3.5" strokeWidth="1.5" />
@@ -394,7 +394,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
downloadJSONExport(); downloadJSONExport();
}} }}
@@ -404,7 +404,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
downloadTxt(); downloadTxt();
}} }}
@@ -414,7 +414,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
downloadPdf(); downloadPdf();
}} }}
@@ -426,7 +426,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
id="chat-copy-button" id="chat-copy-button"
on:click={async () => { on:click={async () => {
const res = await copyToClipboard(await getChatAsText()).catch((e) => { const res = await copyToClipboard(await getChatAsText()).catch((e) => {
@@ -450,7 +450,7 @@
<button <button
slot="trigger" slot="trigger"
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
> >
<Folder className="size-3.5" strokeWidth="1.5" /> <Folder className="size-3.5" strokeWidth="1.5" />
@@ -460,7 +460,7 @@
{#if folder?.id} {#if folder?.id}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 overflow-hidden rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 overflow-hidden rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
moveChatHandler(chat.id, folder.id); moveChatHandler(chat.id, folder.id);
}} }}
@@ -478,7 +478,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
archiveChatHandler(); archiveChatHandler();
}} }}
@@ -489,7 +489,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
deleteChatHandler(); deleteChatHandler();
}} }}
@@ -304,7 +304,7 @@
{#if $user?.role === 'admin' || ($user.permissions?.chat?.share ?? true)} {#if $user?.role === 'admin' || ($user.permissions?.chat?.share ?? true)}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
shareHandler(); shareHandler();
}} }}
@@ -319,7 +319,7 @@
<button <button
slot="trigger" slot="trigger"
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
> >
<Download className="size-3.5" strokeWidth="1.5" /> <Download className="size-3.5" strokeWidth="1.5" />
<div class="flex items-center">{$i18n.t('Download')}</div> <div class="flex items-center">{$i18n.t('Download')}</div>
@@ -327,7 +327,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
downloadJSONExport(); downloadJSONExport();
}} }}
@@ -337,7 +337,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
downloadTxt(); downloadTxt();
}} }}
@@ -347,7 +347,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 select-none w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 select-none w-full"
on:click={() => { on:click={() => {
downloadPdf(); downloadPdf();
}} }}
@@ -359,7 +359,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
show = false; show = false;
renameHandler(); renameHandler();
@@ -373,7 +373,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
show = false; show = false;
pinHandler(); pinHandler();
@@ -391,7 +391,7 @@
{#if $user?.role === 'admin' || ($user?.permissions?.chat?.import ?? true)} {#if $user?.role === 'admin' || ($user?.permissions?.chat?.import ?? true)}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
show = false; show = false;
cloneChatHandler(); cloneChatHandler();
@@ -407,7 +407,7 @@
<button <button
slot="trigger" slot="trigger"
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 select-none w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 select-none w-full"
> >
<Folder className="size-3.5" /> <Folder className="size-3.5" />
<div class="flex items-center">{$i18n.t('Move')}</div> <div class="flex items-center">{$i18n.t('Move')}</div>
@@ -416,7 +416,7 @@
{#each $folders.sort((a, b) => b.updated_at - a.updated_at) as folder} {#each $folders.sort((a, b) => b.updated_at - a.updated_at) as folder}
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 overflow-hidden w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 overflow-hidden w-full"
on:click={() => { on:click={() => {
moveChatHandler(chatId, folder.id); moveChatHandler(chatId, folder.id);
}} }}
@@ -433,7 +433,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
archiveChatHandler(); archiveChatHandler();
}} }}
@@ -444,7 +444,7 @@
<button <button
draggable="false" draggable="false"
class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60 w-full" class="flex h-[1.6875rem] gap-2 items-center rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 w-full"
on:click={() => { on:click={() => {
deleteHandler(); deleteHandler();
}} }}
@@ -45,7 +45,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu className="min-w-[170px]"> <DropdownMenu className="min-w-[170px]">
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onCreateSubFolder(); onCreateSubFolder();
}} }}
@@ -57,7 +57,7 @@
<hr class="border-gray-50/30 dark:border-gray-800/30 mx-1 my-0.5" /> <hr class="border-gray-50/30 dark:border-gray-800/30 mx-1 my-0.5" />
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onEdit(); onEdit();
}} }}
@@ -67,7 +67,7 @@
</button> </button>
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onExport(); onExport();
}} }}
@@ -77,7 +77,7 @@
</button> </button>
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onShare(); onShare();
}} }}
@@ -102,7 +102,7 @@
<hr class="border-gray-50/30 dark:border-gray-800/30 mx-1 my-0.5" /> <hr class="border-gray-50/30 dark:border-gray-800/30 mx-1 my-0.5" />
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
on:click={() => { on:click={() => {
onDelete(); onDelete();
}} }}
@@ -127,7 +127,7 @@
{#if $user?.status_emoji || $user?.status_message} {#if $user?.status_emoji || $user?.status_message}
<div class="user-menu-status"> <div class="user-menu-status">
<button <button
class="w-full h-[1.6875rem] gap-2 rounded-xl px-2 hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none text-[13px] flex items-center" class="w-full h-[1.6875rem] gap-2 rounded-xl px-2 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none text-[13px] flex items-center"
type="button" type="button"
on:click={() => { on:click={() => {
show = false; show = false;
@@ -179,7 +179,7 @@
{:else} {:else}
<div class="user-menu-status"> <div class="user-menu-status">
<button <button
class="w-full h-[1.6875rem] gap-1 rounded-xl px-2 hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none text-[13px] flex items-center justify-center" class="w-full h-[1.6875rem] gap-1 rounded-xl px-2 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none text-[13px] flex items-center justify-center"
type="button" type="button"
on:click={() => { on:click={() => {
show = false; show = false;
@@ -198,7 +198,7 @@
{/if} {/if}
<button <button
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
type="button" type="button"
on:click={async () => { on:click={async () => {
show = false; show = false;
@@ -221,7 +221,7 @@
<a <a
href="/admin" href="/admin"
draggable="false" draggable="false"
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) {
return; return;
@@ -243,7 +243,7 @@
{/if} {/if}
<button <button
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
type="button" type="button"
on:click={async () => { on:click={async () => {
show = false; show = false;
@@ -270,7 +270,7 @@
<a <a
href="/workspace" href="/workspace"
draggable="false" draggable="false"
class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); e.preventDefault();
@@ -327,7 +327,7 @@
<a <a
href="/notes" href="/notes"
draggable="false" draggable="false"
class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); e.preventDefault();
@@ -371,7 +371,7 @@
<a <a
href="/calendar" href="/calendar"
draggable="false" draggable="false"
class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); e.preventDefault();
@@ -424,7 +424,7 @@
<a <a
href="/automations" href="/automations"
draggable="false" draggable="false"
class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); e.preventDefault();
@@ -481,7 +481,7 @@
<a <a
href="/playground" href="/playground"
draggable="false" draggable="false"
class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex flex-1 h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
on:click={async (e) => { on:click={async (e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); e.preventDefault();
@@ -530,7 +530,7 @@
href="https://docs.openwebui.com" href="https://docs.openwebui.com"
target="_blank" target="_blank"
draggable="false" draggable="false"
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
id="chat-share-button" id="chat-share-button"
on:click={() => { on:click={() => {
show = false; show = false;
@@ -547,7 +547,7 @@
href="https://github.com/open-webui/open-webui/releases" href="https://github.com/open-webui/open-webui/releases"
target="_blank" target="_blank"
draggable="false" draggable="false"
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
id="chat-share-button" id="chat-share-button"
on:click={() => { on:click={() => {
show = false; show = false;
@@ -561,7 +561,7 @@
{/if} {/if}
<button <button
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
type="button" type="button"
id="chat-share-button" id="chat-share-button"
on:click={async () => { on:click={async () => {
@@ -584,7 +584,7 @@
<hr class="border-gray-50/30 dark:border-gray-800/30 my-0.5 mx-1 p-0" /> <hr class="border-gray-50/30 dark:border-gray-800/30 my-0.5 mx-1 p-0" />
<button <button
class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none" class="flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[13px] w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition cursor-pointer select-none"
type="button" type="button"
on:click={async () => { on:click={async () => {
const res = await userSignOut(); const res = await userSignOut();
+5 -5
View File
@@ -391,7 +391,7 @@
class="p-1.5 text-sm font-medium bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 transition rounded-lg" class="p-1.5 text-sm font-medium bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 transition rounded-lg"
aria-label={$i18n.t('More options')} aria-label={$i18n.t('More options')}
> >
<EllipsisHorizontal className="size-4" /> <EllipsisHorizontal className="size-3.5" />
</button> </button>
<div slot="content"> <div slot="content">
@@ -399,13 +399,13 @@
<DropdownSub contentClass="select-none z-50"> <DropdownSub contentClass="select-none z-50">
<button <button
slot="trigger" slot="trigger"
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
> >
<Download className="size-3.5" strokeWidth="1.5" /> <Download className="size-3.5" strokeWidth="1.5" />
<div class="flex items-center">{$i18n.t('Download')}</div> <div class="flex items-center">{$i18n.t('Download')}</div>
</button> </button>
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
disabled={messages.length === 0} disabled={messages.length === 0}
on:click={() => { on:click={() => {
exportToJson(); exportToJson();
@@ -416,7 +416,7 @@
</div> </div>
</button> </button>
<button <button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/60 dark:hover:bg-gray-800/60" class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
disabled={messages.length === 0} disabled={messages.length === 0}
on:click={() => { on:click={() => {
downloadTxt(); downloadTxt();
@@ -517,7 +517,7 @@
showControls = !showControls; showControls = !showControls;
}} }}
> >
<AdjustmentsHorizontal className="size-4" /> <AdjustmentsHorizontal className="size-3.5" />
</button> </button>
<div class="flex gap-2 shrink-0"> <div class="flex gap-2 shrink-0">
+11 -6
View File
@@ -1,8 +1,13 @@
import { get, readonly, writable } from 'svelte/store'; import { get, readonly, writable } from 'svelte/store';
import { getChatList, getPinnedChatList } from '$lib/apis/chats'; import { getChatList, getPinnedChatList } from '$lib/apis/chats';
const chatsStore = writable(null); type ChatListItem = {
const pinnedChatsStore = writable([]); id: string;
[key: string]: any;
};
const chatsStore = writable<ChatListItem[] | null>(null);
const pinnedChatsStore = writable<ChatListItem[]>([]);
export const chats = readonly(chatsStore); export const chats = readonly(chatsStore);
export const pinnedChats = readonly(pinnedChatsStore); export const pinnedChats = readonly(pinnedChatsStore);
@@ -32,10 +37,10 @@ export const refreshChatList = async (
loadingNextPage = false; loadingNextPage = false;
const [nextChats, nextPinnedChats] = await Promise.all([ const [nextChats, nextPinnedChats] = await Promise.all([
getChatList(token, 1), getChatList(token, 1) as Promise<ChatListItem[]>,
options.refreshPinned && !options.clearPinned options.refreshPinned && !options.clearPinned
? getPinnedChatList(token) ? (getPinnedChatList(token) as Promise<ChatListItem[]>)
: Promise.resolve(undefined) : Promise.resolve(undefined as ChatListItem[] | undefined)
]); ]);
if (generation !== requestGeneration) { if (generation !== requestGeneration) {
@@ -66,7 +71,7 @@ export const loadNextChatListPage = async (token: string = ''): Promise<ChatList
loadingNextPage = true; loadingNextPage = true;
try { try {
const nextChats = await getChatList(token, nextPage); const nextChats = (await getChatList(token, nextPage)) as ChatListItem[];
if (generation !== requestGeneration) { if (generation !== requestGeneration) {
return { accepted: false, allLoaded }; return { accepted: false, allLoaded };