mirror of
https://github.com/open-webui/open-webui
synced 2025-05-15 19:16:35 +00:00
refac: styling
This commit is contained in:
parent
13019acce6
commit
308a2e1de0
@ -8,6 +8,7 @@
|
|||||||
mobile,
|
mobile,
|
||||||
modelfiles,
|
modelfiles,
|
||||||
settings,
|
settings,
|
||||||
|
showArchivedChats,
|
||||||
showSettings,
|
showSettings,
|
||||||
showSidebar,
|
showSidebar,
|
||||||
user
|
user
|
||||||
@ -163,7 +164,7 @@
|
|||||||
role={$user.role}
|
role={$user.role}
|
||||||
on:show={(e) => {
|
on:show={(e) => {
|
||||||
if (e.detail === 'archived-chat') {
|
if (e.detail === 'archived-chat') {
|
||||||
// showArchivedChatsModal = true;
|
showArchivedChats.set(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
chatId,
|
chatId,
|
||||||
tags,
|
tags,
|
||||||
showSidebar,
|
showSidebar,
|
||||||
mobile
|
mobile,
|
||||||
|
showArchivedChats
|
||||||
} from '$lib/stores';
|
} from '$lib/stores';
|
||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
|
|
||||||
@ -49,7 +50,6 @@
|
|||||||
let chatTitleEditId = null;
|
let chatTitleEditId = null;
|
||||||
let chatTitle = '';
|
let chatTitle = '';
|
||||||
|
|
||||||
let showArchivedChatsModal = false;
|
|
||||||
let showShareChatModal = false;
|
let showShareChatModal = false;
|
||||||
let showDropdown = false;
|
let showDropdown = false;
|
||||||
let isEditing = false;
|
let isEditing = false;
|
||||||
@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
<ShareChatModal bind:show={showShareChatModal} chatId={shareChatId} />
|
<ShareChatModal bind:show={showShareChatModal} chatId={shareChatId} />
|
||||||
<ArchivedChatsModal
|
<ArchivedChatsModal
|
||||||
bind:show={showArchivedChatsModal}
|
bind:show={$showArchivedChats}
|
||||||
on:change={async () => {
|
on:change={async () => {
|
||||||
await chats.set(await getChatList(localStorage.token));
|
await chats.set(await getChatList(localStorage.token));
|
||||||
}}
|
}}
|
||||||
@ -581,6 +581,9 @@
|
|||||||
shareChatId = selectedChatId;
|
shareChatId = selectedChatId;
|
||||||
showShareChatModal = true;
|
showShareChatModal = true;
|
||||||
}}
|
}}
|
||||||
|
archiveChatHandler={() => {
|
||||||
|
archiveChatHandler(chat.id);
|
||||||
|
}}
|
||||||
renameHandler={() => {
|
renameHandler={() => {
|
||||||
chatTitle = chat.title;
|
chatTitle = chat.title;
|
||||||
chatTitleEditId = chat.id;
|
chatTitleEditId = chat.id;
|
||||||
@ -612,18 +615,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</ChatMenu>
|
</ChatMenu>
|
||||||
|
|
||||||
<Tooltip content={$i18n.t('Archive')}>
|
|
||||||
<button
|
|
||||||
aria-label="Archive"
|
|
||||||
class=" self-center dark:hover:text-white transition"
|
|
||||||
on:click={() => {
|
|
||||||
archiveChatHandler(chat.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ArchiveBox />
|
|
||||||
</button>
|
|
||||||
</Tooltip>
|
|
||||||
|
|
||||||
{#if chat.id === $chatId}
|
{#if chat.id === $chatId}
|
||||||
<button
|
<button
|
||||||
id="delete-chat-button"
|
id="delete-chat-button"
|
||||||
@ -662,7 +653,7 @@
|
|||||||
role={$user.role}
|
role={$user.role}
|
||||||
on:show={(e) => {
|
on:show={(e) => {
|
||||||
if (e.detail === 'archived-chat') {
|
if (e.detail === 'archived-chat') {
|
||||||
showArchivedChatsModal = true;
|
showArchivedChats.set(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -9,10 +9,12 @@
|
|||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import Tags from '$lib/components/chat/Tags.svelte';
|
import Tags from '$lib/components/chat/Tags.svelte';
|
||||||
import Share from '$lib/components/icons/Share.svelte';
|
import Share from '$lib/components/icons/Share.svelte';
|
||||||
|
import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
export let shareHandler: Function;
|
export let shareHandler: Function;
|
||||||
|
export let archiveChatHandler: Function;
|
||||||
export let renameHandler: Function;
|
export let renameHandler: Function;
|
||||||
export let deleteHandler: Function;
|
export let deleteHandler: Function;
|
||||||
export let onClose: Function;
|
export let onClose: Function;
|
||||||
@ -36,7 +38,7 @@
|
|||||||
|
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<DropdownMenu.Content
|
<DropdownMenu.Content
|
||||||
class="w-full max-w-[180px] rounded-xl px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow"
|
class="w-full max-w-[160px] rounded-xl px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow"
|
||||||
sideOffset={-2}
|
sideOffset={-2}
|
||||||
side="bottom"
|
side="bottom"
|
||||||
align="start"
|
align="start"
|
||||||
@ -62,6 +64,16 @@
|
|||||||
<div class="flex items-center">{$i18n.t('Rename')}</div>
|
<div class="flex items-center">{$i18n.t('Rename')}</div>
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
|
<DropdownMenu.Item
|
||||||
|
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer dark:hover:bg-gray-800 rounded-md"
|
||||||
|
on:click={() => {
|
||||||
|
archiveChatHandler();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ArchiveBox strokeWidth="2" />
|
||||||
|
<div class="flex items-center">{$i18n.t('Archive')}</div>
|
||||||
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer dark:hover:bg-gray-800 rounded-md"
|
class="flex gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer dark:hover:bg-gray-800 rounded-md"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -39,6 +39,7 @@ export const settings: Writable<Settings> = writable({});
|
|||||||
|
|
||||||
export const showSidebar = writable(false);
|
export const showSidebar = writable(false);
|
||||||
export const showSettings = writable(false);
|
export const showSettings = writable(false);
|
||||||
|
export const showArchivedChats = writable(false);
|
||||||
export const showChangelog = writable(false);
|
export const showChangelog = writable(false);
|
||||||
|
|
||||||
type Model = OpenAIModel | OllamaModel;
|
type Model = OpenAIModel | OllamaModel;
|
||||||
|
Loading…
Reference in New Issue
Block a user