Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
308a2e1d
Commit
308a2e1d
authored
May 14, 2024
by
Timothy J. Baek
Browse files
refac: styling
parent
13019acc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
src/lib/components/layout/Navbar.svelte
src/lib/components/layout/Navbar.svelte
+2
-1
src/lib/components/layout/Sidebar.svelte
src/lib/components/layout/Sidebar.svelte
+7
-16
src/lib/components/layout/Sidebar/ChatMenu.svelte
src/lib/components/layout/Sidebar/ChatMenu.svelte
+13
-1
src/lib/stores/index.ts
src/lib/stores/index.ts
+1
-0
No files found.
src/lib/components/layout/Navbar.svelte
View file @
308a2e1d
...
...
@@ -8,6 +8,7 @@
mobile,
modelfiles,
settings,
showArchivedChats,
showSettings,
showSidebar,
user
...
...
@@ -163,7 +164,7 @@
role={$user.role}
on:show={(e) => {
if (e.detail === 'archived-chat') {
//
showArchivedChats
Modal =
true;
showArchivedChats
.set(
true
)
;
}
}}
>
...
...
src/lib/components/layout/Sidebar.svelte
View file @
308a2e1d
...
...
@@ -8,7 +8,8 @@
chatId,
tags,
showSidebar,
mobile
mobile,
showArchivedChats
} from '$lib/stores';
import { onMount, getContext } from 'svelte';
...
...
@@ -49,7 +50,6 @@
let chatTitleEditId = null;
let chatTitle = '';
let showArchivedChatsModal = false;
let showShareChatModal = false;
let showDropdown = false;
let isEditing = false;
...
...
@@ -186,7 +186,7 @@
<ShareChatModal bind:show={showShareChatModal} chatId={shareChatId} />
<ArchivedChatsModal
bind:show={showArchivedChats
Modal
}
bind:show={
$
showArchivedChats}
on:change={async () => {
await chats.set(await getChatList(localStorage.token));
}}
...
...
@@ -581,6 +581,9 @@
shareChatId = selectedChatId;
showShareChatModal = true;
}}
archiveChatHandler={() => {
archiveChatHandler(chat.id);
}}
renameHandler={() => {
chatTitle = chat.title;
chatTitleEditId = chat.id;
...
...
@@ -612,18 +615,6 @@
</button>
</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}
<button
id="delete-chat-button"
...
...
@@ -662,7 +653,7 @@
role={$user.role}
on:show={(e) => {
if (e.detail === 'archived-chat') {
showArchivedChats
Modal =
true;
showArchivedChats
.set(
true
)
;
}
}}
>
...
...
src/lib/components/layout/Sidebar/ChatMenu.svelte
View file @
308a2e1d
...
...
@@ -9,10 +9,12 @@
import Tooltip from '$lib/components/common/Tooltip.svelte';
import Tags from '$lib/components/chat/Tags.svelte';
import Share from '$lib/components/icons/Share.svelte';
import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte';
const i18n = getContext('i18n');
export let shareHandler: Function;
export let archiveChatHandler: Function;
export let renameHandler: Function;
export let deleteHandler: Function;
export let onClose: Function;
...
...
@@ -36,7 +38,7 @@
<div slot="content">
<DropdownMenu.Content
class="w-full max-w-[1
8
0px] 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-[1
6
0px] 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}
side="bottom"
align="start"
...
...
@@ -62,6 +64,16 @@
<div class="flex items-center">{$i18n.t('Rename')}</div>
</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
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={() => {
...
...
src/lib/stores/index.ts
View file @
308a2e1d
...
...
@@ -39,6 +39,7 @@ export const settings: Writable<Settings> = writable({});
export
const
showSidebar
=
writable
(
false
);
export
const
showSettings
=
writable
(
false
);
export
const
showArchivedChats
=
writable
(
false
);
export
const
showChangelog
=
writable
(
false
);
type
Model
=
OpenAIModel
|
OllamaModel
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment