mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
dc4b828852
commit
3026ac64a2
1 changed files with 19 additions and 20 deletions
|
|
@ -826,7 +826,7 @@
|
|||
aria-label={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')}
|
||||
>
|
||||
<div
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50/40 dark:group-hover:bg-gray-800/40"
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50 dark:group-hover:bg-gray-900"
|
||||
>
|
||||
<img
|
||||
src="{WEBUI_BASE_URL}/static/favicon.png"
|
||||
|
|
@ -857,7 +857,7 @@
|
|||
aria-label={$i18n.t('New Chat')}
|
||||
>
|
||||
<div
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50/40 dark:group-hover:bg-gray-800/40"
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50 dark:group-hover:bg-gray-900"
|
||||
>
|
||||
<EditPencilIcon className="size-4" strokeWidth="1.5" />
|
||||
</div>
|
||||
|
|
@ -879,7 +879,7 @@
|
|||
aria-label={$i18n.t('Search')}
|
||||
>
|
||||
<div
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50/40 dark:group-hover:bg-gray-800/40"
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50 dark:group-hover:bg-gray-900"
|
||||
>
|
||||
<SearchIcon className="size-4" strokeWidth="1.5" />
|
||||
</div>
|
||||
|
|
@ -893,10 +893,7 @@
|
|||
<div class="">
|
||||
<Tooltip content={$i18n.t(meta.label)} placement="right">
|
||||
<a
|
||||
class=" cursor-pointer flex size-8 items-center justify-center transition group {itemId ===
|
||||
activeMenuItemId
|
||||
? 'text-gray-900 dark:text-gray-100'
|
||||
: ''}"
|
||||
class=" cursor-pointer flex size-8 items-center justify-center transition group"
|
||||
href={meta.href}
|
||||
on:click={async (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
|
|
@ -910,8 +907,10 @@
|
|||
<div
|
||||
class=" self-center flex size-[30px] items-center justify-center rounded-lg transition {itemId ===
|
||||
activeMenuItemId
|
||||
? 'bg-gray-100/80 dark:bg-gray-850/50'
|
||||
: 'group-hover:bg-gray-50/40 dark:group-hover:bg-gray-800/40'}"
|
||||
? ($settings?.highContrastMode ?? false)
|
||||
? 'bg-black/[0.035] dark:bg-white/[0.06]'
|
||||
: 'bg-black/[0.035] dark:bg-white/[0.045]'
|
||||
: 'group-hover:bg-gray-50 dark:group-hover:bg-gray-900'}"
|
||||
>
|
||||
{#if itemId === 'notes'}
|
||||
<NotesIcon className="size-4" strokeWidth="1.5" />
|
||||
|
|
@ -944,7 +943,7 @@
|
|||
aria-label={$i18n.t('User menu')}
|
||||
>
|
||||
<div
|
||||
class="self-center relative flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50/40 dark:group-hover:bg-gray-800/40"
|
||||
class="self-center relative flex size-[30px] items-center justify-center rounded-lg transition group-hover:bg-gray-50 dark:group-hover:bg-gray-900"
|
||||
>
|
||||
<img
|
||||
src={`${WEBUI_API_BASE_URL}/users/${$user?.id}/profile/image`}
|
||||
|
|
@ -999,7 +998,7 @@
|
|||
class="sidebar px-1 pt-1.5 pb-1 flex justify-between space-x-1 text-gray-600 dark:text-gray-400 sticky top-0 z-10 -mb-2"
|
||||
>
|
||||
<a
|
||||
class="flex items-center rounded-xl size-8.5 h-full justify-center hover:bg-gray-50/60 dark:hover:bg-gray-800/40 transition no-drag-region"
|
||||
class="flex items-center rounded-xl size-8.5 h-full justify-center hover:bg-gray-50 dark:hover:bg-gray-900 transition no-drag-region"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={newChatHandler}
|
||||
|
|
@ -1025,7 +1024,7 @@
|
|||
placement="bottom"
|
||||
>
|
||||
<button
|
||||
class="flex size-[30px] justify-center items-center rounded-lg hover:bg-gray-50/60 dark:hover:bg-gray-800/40 transition {isWindows
|
||||
class="flex size-[30px] justify-center items-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-900 transition {isWindows
|
||||
? 'cursor-pointer'
|
||||
: 'cursor-[w-resize]'}"
|
||||
on:click={() => {
|
||||
|
|
@ -1060,7 +1059,7 @@
|
|||
<div class="px-1 flex justify-center text-gray-700 dark:text-gray-300">
|
||||
<a
|
||||
id="sidebar-new-chat-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl px-2 py-1.5 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition outline-none"
|
||||
class="group grow flex items-center space-x-2 rounded-xl px-2 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-900 transition outline-none"
|
||||
href="/"
|
||||
draggable="false"
|
||||
on:click={newChatHandler}
|
||||
|
|
@ -1081,7 +1080,7 @@
|
|||
<div class="px-1 flex justify-center text-gray-700 dark:text-gray-300">
|
||||
<button
|
||||
id="sidebar-search-button"
|
||||
class="group grow flex items-center space-x-2 rounded-xl px-2 py-1.5 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition outline-none"
|
||||
class="group grow flex items-center space-x-2 rounded-xl px-2 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-900 transition outline-none"
|
||||
on:click={() => {
|
||||
showSearch.set(true);
|
||||
}}
|
||||
|
|
@ -1104,17 +1103,17 @@
|
|||
{@const meta = getMenuItemMeta(itemId)}
|
||||
{#if meta && isMenuItemVisible(itemId)}
|
||||
<div
|
||||
class="px-1 flex justify-center {itemId === activeMenuItemId
|
||||
? 'text-gray-900 dark:text-gray-100'
|
||||
: 'text-gray-700 dark:text-gray-300'}"
|
||||
class="px-1 flex justify-center text-gray-700 dark:text-gray-300"
|
||||
data-id={itemId}
|
||||
>
|
||||
<a
|
||||
id="sidebar-{itemId}-button"
|
||||
class="grow flex items-center space-x-2 rounded-xl px-2 py-1.5 transition {itemId ===
|
||||
activeMenuItemId
|
||||
? 'bg-gray-100/80 dark:bg-gray-850/50'
|
||||
: 'hover:bg-gray-50/40 dark:hover:bg-gray-800/40'}"
|
||||
? ($settings?.highContrastMode ?? false)
|
||||
? 'bg-black/[0.035] dark:bg-white/[0.06]'
|
||||
: 'bg-black/[0.035] dark:bg-white/[0.045]'
|
||||
: 'hover:bg-gray-50 dark:hover:bg-gray-900'}"
|
||||
href={meta.href}
|
||||
on:click={itemClickHandler}
|
||||
draggable="false"
|
||||
|
|
@ -1527,7 +1526,7 @@
|
|||
>
|
||||
<button
|
||||
type="button"
|
||||
class=" flex items-center rounded-xl py-1.5 px-1.5 w-full hover:bg-gray-50/40 dark:hover:bg-gray-800/40 transition"
|
||||
class=" flex items-center rounded-xl py-1.5 px-1.5 w-full hover:bg-gray-50 dark:hover:bg-gray-900 transition"
|
||||
aria-label={$i18n.t('User menu')}
|
||||
>
|
||||
<div class=" self-center mr-3 relative flex-shrink-0">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue