mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
refac
This commit is contained in:
1 parent
61930817db
commit
2706b137bf
2 files changed
+111
-90
No files matched your search
@@ -204,6 +204,12 @@
|
||||
>
|
||||
{/each}
|
||||
</div>
|
||||
<a
|
||||
class="mt-2 block w-fit text-[10px] hover:text-base-500"
|
||||
href="https://github.com/open-webui/open-webui"
|
||||
target="_blank"
|
||||
>{$i18n.t('Full license texts ship with Open WebUI and alongside each package.')}</a
|
||||
>
|
||||
</details>
|
||||
|
||||
<div class="text-xs text-base-400 dark:text-base-600">
|
||||
|
||||
@@ -448,7 +448,12 @@
|
||||
folderRegistry[folder.id]?.setFolderItems?.(false, false);
|
||||
};
|
||||
|
||||
$: pinnedItems = $settings?.pinnedMenuItems ?? DEFAULT_PINNED_ITEMS;
|
||||
// New Chat and Search are always shown; a saved order without them puts them first.
|
||||
$: savedPinnedItems = $settings?.pinnedMenuItems ?? DEFAULT_PINNED_ITEMS;
|
||||
$: pinnedItems = [
|
||||
...['newChat', 'search'].filter((id) => !savedPinnedItems.includes(id)),
|
||||
...savedPinnedItems
|
||||
];
|
||||
|
||||
$: isMenuItemVisible = (id) => {
|
||||
switch (id) {
|
||||
@@ -1574,54 +1579,54 @@
|
||||
</div>
|
||||
|
||||
<div class="-gap-0.5">
|
||||
<div class="">
|
||||
<Tooltip content={$i18n.t('New Chat')} placement="right">
|
||||
<a
|
||||
class=" cursor-pointer flex h-7.5 w-8 items-center justify-center transition group"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={async (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
newChatHandler();
|
||||
}}
|
||||
aria-label={$i18n.t('New Chat')}
|
||||
>
|
||||
<div
|
||||
class="self-center flex size-[calc(30px*var(--app-text-scale,1))] items-center justify-center rounded-xl transition group-hover:bg-base-100 dark:group-hover:bg-base-900"
|
||||
>
|
||||
<EditPencilIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Tooltip content={$i18n.t('Search')} placement="right">
|
||||
<button
|
||||
class=" cursor-pointer flex h-7.5 w-8 items-center justify-center transition group"
|
||||
on:click={(e) => {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
showSearch.set(true);
|
||||
}}
|
||||
draggable="false"
|
||||
aria-label={$i18n.t('Search')}
|
||||
>
|
||||
<div
|
||||
class="self-center flex size-[calc(30px*var(--app-text-scale,1))] items-center justify-center rounded-xl transition group-hover:bg-base-100 dark:group-hover:bg-base-900"
|
||||
>
|
||||
<SearchIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
{#each pinnedItems as itemId (itemId)}
|
||||
{@const meta = getMenuItemMeta(itemId)}
|
||||
{#if meta && isMenuItemVisible(itemId)}
|
||||
{#if itemId === 'newChat'}
|
||||
<div class="">
|
||||
<Tooltip content={$i18n.t('New Chat')} placement="right">
|
||||
<a
|
||||
class=" cursor-pointer flex h-7.5 w-8 items-center justify-center transition group"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={async (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
newChatHandler();
|
||||
}}
|
||||
aria-label={$i18n.t('New Chat')}
|
||||
>
|
||||
<div
|
||||
class="self-center flex size-[calc(30px*var(--app-text-scale,1))] items-center justify-center rounded-xl transition group-hover:bg-base-100 dark:group-hover:bg-base-900"
|
||||
>
|
||||
<EditPencilIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{:else if itemId === 'search'}
|
||||
<div>
|
||||
<Tooltip content={$i18n.t('Search')} placement="right">
|
||||
<button
|
||||
class=" cursor-pointer flex h-7.5 w-8 items-center justify-center transition group"
|
||||
on:click={(e) => {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
showSearch.set(true);
|
||||
}}
|
||||
draggable="false"
|
||||
aria-label={$i18n.t('Search')}
|
||||
>
|
||||
<div
|
||||
class="self-center flex size-[calc(30px*var(--app-text-scale,1))] items-center justify-center rounded-xl transition group-hover:bg-base-100 dark:group-hover:bg-base-900"
|
||||
>
|
||||
<SearchIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{:else if meta && isMenuItemVisible(itemId)}
|
||||
<div class="">
|
||||
<Tooltip content={$i18n.t(meta.label)} placement="right">
|
||||
<a
|
||||
@@ -1826,52 +1831,62 @@
|
||||
}}
|
||||
>
|
||||
<div class="pb-1">
|
||||
<div class="px-1 flex justify-center text-base-700 dark:text-base-300">
|
||||
<a
|
||||
id="sidebar-new-chat-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl h-7.5 px-2 hover:bg-base-100 dark:hover:bg-base-900 transition outline-none"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={newChatHandler}
|
||||
aria-label={$i18n.t('New Chat')}
|
||||
>
|
||||
<div class="self-center flex size-4 shrink-0 items-center justify-center">
|
||||
<EditPencilIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-1 self-center translate-y-[0.5px]">
|
||||
<div class=" self-center text-[0.8125rem] leading-5">{$i18n.t('New Chat')}</div>
|
||||
</div>
|
||||
|
||||
<HotkeyHint name="newChat" className=" hover-reveal " />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="px-1 flex justify-center text-base-700 dark:text-base-300">
|
||||
<button
|
||||
id="sidebar-search-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl h-7.5 px-2 hover:bg-base-100 dark:hover:bg-base-900 transition outline-none"
|
||||
on:click={() => {
|
||||
showSearch.set(true);
|
||||
}}
|
||||
draggable="false"
|
||||
aria-label={$i18n.t('Search')}
|
||||
>
|
||||
<div class="self-center flex size-4 shrink-0 items-center justify-center">
|
||||
<SearchIcon strokeWidth="1.5" className="size-3.75" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-1 self-center translate-y-[0.5px]">
|
||||
<div class=" self-center text-[0.8125rem] leading-5">{$i18n.t('Search')}</div>
|
||||
</div>
|
||||
<HotkeyHint name="search" className=" hover-reveal " />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="pinned-menu-items-list">
|
||||
{#each pinnedItems as itemId (itemId)}
|
||||
{@const meta = getMenuItemMeta(itemId)}
|
||||
{#if meta && isMenuItemVisible(itemId)}
|
||||
{#if itemId === 'newChat'}
|
||||
<div
|
||||
class="px-1 flex justify-center text-base-700 dark:text-base-300"
|
||||
data-id={itemId}
|
||||
>
|
||||
<a
|
||||
id="sidebar-new-chat-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl h-7.5 px-2 hover:bg-base-100 dark:hover:bg-base-900 transition outline-none"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={newChatHandler}
|
||||
aria-label={$i18n.t('New Chat')}
|
||||
>
|
||||
<div class="self-center flex size-4 shrink-0 items-center justify-center">
|
||||
<EditPencilIcon className="size-3.75" strokeWidth="1.5" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-1 self-center translate-y-[0.5px]">
|
||||
<div class=" self-center text-[0.8125rem] leading-5">
|
||||
{$i18n.t('New Chat')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<HotkeyHint name="newChat" className=" hover-reveal " />
|
||||
</a>
|
||||
</div>
|
||||
{:else if itemId === 'search'}
|
||||
<div
|
||||
class="px-1 flex justify-center text-base-700 dark:text-base-300"
|
||||
data-id={itemId}
|
||||
>
|
||||
<button
|
||||
id="sidebar-search-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl h-7.5 px-2 hover:bg-base-100 dark:hover:bg-base-900 transition outline-none"
|
||||
on:click={() => {
|
||||
showSearch.set(true);
|
||||
}}
|
||||
draggable="false"
|
||||
aria-label={$i18n.t('Search')}
|
||||
>
|
||||
<div class="self-center flex size-4 shrink-0 items-center justify-center">
|
||||
<SearchIcon strokeWidth="1.5" className="size-3.75" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-1 self-center translate-y-[0.5px]">
|
||||
<div class=" self-center text-[0.8125rem] leading-5">
|
||||
{$i18n.t('Search')}
|
||||
</div>
|
||||
</div>
|
||||
<HotkeyHint name="search" className=" hover-reveal " />
|
||||
</button>
|
||||
</div>
|
||||
{:else if meta && isMenuItemVisible(itemId)}
|
||||
<div
|
||||
class="px-1 flex justify-center text-base-700 dark:text-base-300"
|
||||
data-id={itemId}
|
||||
|
||||
Reference in new issue
Block a user