From 9ccb9a87e6feabebf6922a2e6858f37e2995573e Mon Sep 17 00:00:00 2001 From: Silentoplayz <50341825+Silentoplayz@users.noreply.github.com> Date: Sat, 14 Jun 2025 13:56:30 -0400 Subject: [PATCH 1/3] fix: Prevent draggable links for Admin Panel & Playground in UserMenu --- src/lib/components/layout/Sidebar/UserMenu.svelte | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/components/layout/Sidebar/UserMenu.svelte b/src/lib/components/layout/Sidebar/UserMenu.svelte index e816b43e5..6a363c93d 100644 --- a/src/lib/components/layout/Sidebar/UserMenu.svelte +++ b/src/lib/components/layout/Sidebar/UserMenu.svelte @@ -99,10 +99,10 @@ {#if role === 'admin'} - { + goto('/playground'); show = false; if ($mobile) { @@ -127,12 +127,12 @@
{$i18n.t('Playground')}
-
+ - { + goto('/admin'); show = false; if ($mobile) { @@ -157,7 +157,7 @@
{$i18n.t('Admin Panel')}
-
+ {/if} {#if help} From 4fd7bfe19b188b278480ed17f64eaff33aa4ba0b Mon Sep 17 00:00:00 2001 From: Silentoplayz <50341825+Silentoplayz@users.noreply.github.com> Date: Sat, 14 Jun 2025 14:31:20 -0400 Subject: [PATCH 2/3] refac: Icon files for UserMenu --- src/lib/components/icons/Code.svelte | 19 +++++ src/lib/components/icons/Settings.svelte | 20 +++++ src/lib/components/icons/SignOut.svelte | 16 ++++ src/lib/components/icons/UserGroup.svelte | 19 +++++ .../components/layout/Sidebar/UserMenu.svelte | 82 ++++--------------- 5 files changed, 88 insertions(+), 68 deletions(-) create mode 100644 src/lib/components/icons/Code.svelte create mode 100644 src/lib/components/icons/Settings.svelte create mode 100644 src/lib/components/icons/SignOut.svelte create mode 100644 src/lib/components/icons/UserGroup.svelte diff --git a/src/lib/components/icons/Code.svelte b/src/lib/components/icons/Code.svelte new file mode 100644 index 000000000..824df1b40 --- /dev/null +++ b/src/lib/components/icons/Code.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/components/icons/Settings.svelte b/src/lib/components/icons/Settings.svelte new file mode 100644 index 000000000..4e622cda8 --- /dev/null +++ b/src/lib/components/icons/Settings.svelte @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/lib/components/icons/SignOut.svelte b/src/lib/components/icons/SignOut.svelte new file mode 100644 index 000000000..0307cddd3 --- /dev/null +++ b/src/lib/components/icons/SignOut.svelte @@ -0,0 +1,16 @@ + + + + + + diff --git a/src/lib/components/icons/UserGroup.svelte b/src/lib/components/icons/UserGroup.svelte new file mode 100644 index 000000000..b3e9d6ff1 --- /dev/null +++ b/src/lib/components/icons/UserGroup.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/components/layout/Sidebar/UserMenu.svelte b/src/lib/components/layout/Sidebar/UserMenu.svelte index 6a363c93d..70e60f038 100644 --- a/src/lib/components/layout/Sidebar/UserMenu.svelte +++ b/src/lib/components/layout/Sidebar/UserMenu.svelte @@ -4,15 +4,19 @@ import { flyAndScale } from '$lib/utils/transitions'; import { goto } from '$app/navigation'; - import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte'; import { showSettings, activeUserIds, USAGE_POOL, mobile, showSidebar, user } from '$lib/stores'; import { fade, slide } from 'svelte/transition'; import Tooltip from '$lib/components/common/Tooltip.svelte'; import { userSignOut } from '$lib/apis/auths'; + import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte'; import QuestionMarkCircle from '$lib/components/icons/QuestionMarkCircle.svelte'; import Map from '$lib/components/icons/Map.svelte'; import Keyboard from '$lib/components/icons/Keyboard.svelte'; import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte'; + import Settings from '$lib/components/icons/Settings.svelte'; + import Code from '$lib/components/icons/Code.svelte'; + import UserGroup from '$lib/components/icons/UserGroup.svelte'; + import SignOut from '$lib/components/icons/SignOut.svelte'; const i18n = getContext('i18n'); @@ -58,25 +62,7 @@ }} >
- - - - +
{$i18n.t('Settings')}
@@ -111,20 +97,7 @@ }} >
- - - +
{$i18n.t('Playground')}
@@ -141,20 +114,7 @@ }} >
- - - +
{$i18n.t('Admin Panel')}
@@ -165,10 +125,11 @@ { window.open('https://docs.openwebui.com', '_blank'); + show = false; }} > @@ -177,10 +138,11 @@ { window.open('https://github.com/open-webui/open-webui/releases', '_blank'); + show = false; }} > @@ -188,7 +150,7 @@ { showShortcuts = !showShortcuts; @@ -214,23 +176,7 @@ }} >
- - - - +
{$i18n.t('Sign Out')}
From 6e8c6e269ea3a1f240d6f452261ae88fb36a93f0 Mon Sep 17 00:00:00 2001 From: Silentoplayz <50341825+Silentoplayz@users.noreply.github.com> Date: Sat, 14 Jun 2025 18:26:27 -0400 Subject: [PATCH 3/3] fix: select-none w-full --- src/lib/components/layout/Navbar/Menu.svelte | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/components/layout/Navbar/Menu.svelte b/src/lib/components/layout/Navbar/Menu.svelte index 1118f3e3d..6bab404c5 100644 --- a/src/lib/components/layout/Navbar/Menu.svelte +++ b/src/lib/components/layout/Navbar/Menu.svelte @@ -250,7 +250,7 @@ {#if $mobile} { await showControls.set(true); @@ -265,7 +265,7 @@ {#if !$temporaryChatEnabled && ($user?.role === 'admin' || ($user.permissions?.chat?.share ?? true))} { shareHandler(); @@ -288,7 +288,7 @@ {/if} { await showControls.set(true); @@ -301,7 +301,7 @@ { await showControls.set(true); @@ -315,7 +315,7 @@ {#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)} { downloadJSONExport(); }} @@ -350,7 +350,7 @@ {/if} { downloadTxt(); }} @@ -359,7 +359,7 @@ { downloadPdf(); }} @@ -370,7 +370,7 @@ { const res = await copyToClipboard(await getChatAsText()).catch((e) => {