fix: user menu buttons
This commit is contained in:
parent
cd6eb9a9e2
commit
1cbbdf7771
|
@ -71,7 +71,7 @@
|
|||
transition={(e) => fade(e, { duration: 100 })}
|
||||
>
|
||||
<DropdownMenu.Item
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition cursor-pointer"
|
||||
on:click={async () => {
|
||||
await showSettings.set(true);
|
||||
show = false;
|
||||
|
@ -88,7 +88,7 @@
|
|||
</DropdownMenu.Item>
|
||||
|
||||
<DropdownMenu.Item
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition cursor-pointer"
|
||||
on:click={() => {
|
||||
dispatch('show', 'archived-chat');
|
||||
show = false;
|
||||
|
@ -105,70 +105,72 @@
|
|||
</DropdownMenu.Item>
|
||||
|
||||
{#if role === 'admin'}
|
||||
<DropdownMenu.Item
|
||||
<a
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
href="/playground"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
if ($mobile) {
|
||||
showSidebar.set(false);
|
||||
}
|
||||
goto('/playground');
|
||||
}}
|
||||
>
|
||||
<div class=" self-center mr-3">
|
||||
<Code className="size-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Playground')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</a>
|
||||
|
||||
<DropdownMenu.Item
|
||||
<a
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
href="/admin"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
if ($mobile) {
|
||||
showSidebar.set(false);
|
||||
}
|
||||
goto('/admin');
|
||||
}}
|
||||
>
|
||||
<div class=" self-center mr-3">
|
||||
<UserGroup className="w-5 h-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Admin Panel')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
{#if help}
|
||||
<hr class=" border-gray-100 dark:border-gray-800 my-1 p-0" />
|
||||
|
||||
<!-- {$i18n.t('Help')} -->
|
||||
<DropdownMenu.Item
|
||||
<a
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||
id="chat-share-button"
|
||||
href="https://docs.openwebui.com"
|
||||
target="_blank"
|
||||
on:click={() => {
|
||||
window.open('https://docs.openwebui.com', '_blank');
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
<QuestionMarkCircle className="size-5" />
|
||||
<div class="flex items-center">{$i18n.t('Documentation')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</a>
|
||||
|
||||
<!-- Releases -->
|
||||
<DropdownMenu.Item
|
||||
<a
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||
id="menu-item-releases"
|
||||
href="https://github.com/open-webui/open-webui/releases"
|
||||
target="_blank"
|
||||
on:click={() => {
|
||||
window.open('https://github.com/open-webui/open-webui/releases', '_blank');
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
<Map className="size-5" />
|
||||
<div class="flex items-center">{$i18n.t('Releases')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</a>
|
||||
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition cursor-pointer"
|
||||
id="chat-share-button"
|
||||
on:click={() => {
|
||||
showShortcuts.set(!$showShortcuts);
|
||||
|
@ -182,7 +184,7 @@
|
|||
|
||||
<hr class=" border-gray-100 dark:border-gray-800 my-1 p-0" />
|
||||
|
||||
<DropdownMenu.Item
|
||||
<button
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||
on:click={async () => {
|
||||
const res = await userSignOut();
|
||||
|
@ -197,7 +199,7 @@
|
|||
<SignOut className="w-5 h-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Sign Out')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</button>
|
||||
|
||||
{#if usage}
|
||||
{#if usage?.user_ids?.length > 0}
|
||||
|
|
Loading…
Reference in New Issue