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
e6d20df4
"vscode:/vscode.git/clone" did not exist on "954bba9defdf1c1eac18760b5d73488ec6bb5a0c"
Commit
e6d20df4
authored
May 15, 2024
by
Timothy J. Baek
Browse files
refac: styling
parent
de0f3168
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
40 deletions
+73
-40
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+22
-22
src/lib/components/chat/Messages/UserMessage.svelte
src/lib/components/chat/Messages/UserMessage.svelte
+5
-5
src/lib/components/common/Switch.svelte
src/lib/components/common/Switch.svelte
+22
-0
src/lib/components/icons/User.svelte
src/lib/components/icons/User.svelte
+11
-0
src/lib/components/layout/Navbar/Menu.svelte
src/lib/components/layout/Navbar/Menu.svelte
+5
-5
src/lib/components/layout/Sidebar/ChatMenu.svelte
src/lib/components/layout/Sidebar/ChatMenu.svelte
+4
-4
src/lib/components/layout/Sidebar/UserMenu.svelte
src/lib/components/layout/Sidebar/UserMenu.svelte
+4
-4
No files found.
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
e6d20df4
...
...
@@ -491,7 +491,7 @@
{#if message.done || siblings.length > 1}
<div
class=" flex justify-start
space-x-1
overflow-x-auto buttons text-gray-
7
00 dark:text-gray-500"
class=" flex justify-start overflow-x-auto buttons text-gray-
6
00 dark:text-gray-500"
>
{#if siblings.length > 1}
<div class="flex self-center">
...
...
@@ -553,7 +553,7 @@
<button
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition"
on:click={() => {
editMessageHandler();
}}
...
...
@@ -562,7 +562,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -580,7 +580,7 @@
<button
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition copy-response-button"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition copy-response-button"
on:click={() => {
copyToClipboard(message.content);
}}
...
...
@@ -589,7 +589,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -607,8 +607,8 @@
<button
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded {message
?.annotation
?.rating === 1
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
{message
?.annotation
?.rating === 1
? 'bg-gray-100 dark:bg-gray-800'
: ''} dark:hover:text-white hover:text-black transition"
on:click={() => {
...
...
@@ -625,7 +625,7 @@
<svg
stroke="currentColor"
fill="none"
stroke-width="2"
stroke-width="2
.3
"
viewBox="0 0 24 24"
stroke-linecap="round"
stroke-linejoin="round"
...
...
@@ -642,8 +642,8 @@
<button
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded {message
?.annotation
?.rating === -1
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
{message
?.annotation
?.rating === -1
? 'bg-gray-100 dark:bg-gray-800'
: ''} dark:hover:text-white hover:text-black transition"
on:click={() => {
...
...
@@ -659,7 +659,7 @@
<svg
stroke="currentColor"
fill="none"
stroke-width="2"
stroke-width="2
.3
"
viewBox="0 0 24 24"
stroke-linecap="round"
stroke-linejoin="round"
...
...
@@ -678,7 +678,7 @@
id="speak-button-{message.id}"
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition"
on:click={() => {
if (!loadingSpeech) {
toggleSpeakMessage(message);
...
...
@@ -725,7 +725,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -740,7 +740,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -759,7 +759,7 @@
<button
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition"
: 'invisible group-hover:visible'}
p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition"
on:click={() => {
if (!generatingImage) {
generateImage(message);
...
...
@@ -806,7 +806,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -826,7 +826,7 @@
<button
class=" {isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition whitespace-pre-wrap"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition whitespace-pre-wrap"
on:click={() => {
console.log(message);
}}
...
...
@@ -836,7 +836,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -856,7 +856,7 @@
type="button"
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition regenerate-response-button"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition regenerate-response-button"
on:click={() => {
continueGeneration();
}}
...
...
@@ -865,7 +865,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -888,14 +888,14 @@
type="button"
class="{isLastMessage
? 'visible'
: 'invisible group-hover:visible'} p-1 rounded dark:hover:text-white hover:text-black transition regenerate-response-button"
: 'invisible group-hover:visible'} p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition regenerate-response-button"
on:click={regenerateResponse}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
src/lib/components/chat/Messages/UserMessage.svelte
View file @
e6d20df4
...
...
@@ -235,7 +235,7 @@
<div
class=" flex {$settings?.chatBubble ?? true
? 'justify-end'
: ''}
space-x-1
text-gray-
7
00 dark:text-gray-500"
: ''} text-gray-
6
00 dark:text-gray-500"
>
{#if !($settings?.chatBubble ?? true)}
{#if siblings.length > 1}
...
...
@@ -293,7 +293,7 @@
{#if !readOnly}
<Tooltip content={$i18n.t('Edit')} placement="bottom">
<button
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition edit-user-message-button"
class="invisible group-hover:visible p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition edit-user-message-button"
on:click={() => {
editMessageHandler();
}}
...
...
@@ -302,7 +302,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
@@ -318,7 +318,7 @@
<Tooltip content={$i18n.t('Copy')} placement="bottom">
<button
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition"
class="invisible group-hover:visible p-1
.5 hover:bg-black/5 dark:hover:bg-white/5
rounded
-lg
dark:hover:text-white hover:text-black transition"
on:click={() => {
copyToClipboard(message.content);
}}
...
...
@@ -327,7 +327,7 @@
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke-width="2
.3
"
stroke="currentColor"
class="w-4 h-4"
>
...
...
src/lib/components/common/Switch.svelte
0 → 100644
View file @
e6d20df4
<script lang="ts">
import { createEventDispatcher, tick } from 'svelte';
import { Switch } from 'bits-ui';
export let state = true;
const dispatch = createEventDispatcher();
</script>
<Switch.Root
bind:checked={state}
onCheckedChange={async (e) => {
await tick();
dispatch('change', e);
}}
class="flex h-5 min-h-5 w-9 shrink-0 cursor-pointer items-center rounded-full px-[3px] transition {state
? ' bg-emerald-600'
: 'bg-gray-200 dark:bg-transparent'} outline outline-gray-100 dark:outline-gray-800"
>
<Switch.Thumb
class="pointer-events-none block size-4 shrink-0 rounded-full bg-white transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:shadow-mini "
/>
</Switch.Root>
src/lib/components/icons/User.svelte
0 → 100644
View file @
e6d20df4
<script lang="ts">
export let className = 'w-4 h-4';
</script>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class={className}>
<path
fill-rule="evenodd"
d="M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"
clip-rule="evenodd"
/>
</svg>
src/lib/components/layout/Navbar/Menu.svelte
View file @
e6d20df4
...
...
@@ -111,7 +111,7 @@
</DropdownMenu.Item> -->
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer dark:hover:bg-gray-800 rounded-md"
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
id="chat-share-button"
on:click={() => {
shareHandler();
...
...
@@ -140,7 +140,7 @@
/> -->
<DropdownMenu.Sub>
<DropdownMenu.SubTrigger
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer dark:hover:bg-gray-800 rounded-md"
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
>
<svg
xmlns="http://www.w3.org/2000/svg"
...
...
@@ -165,7 +165,7 @@
sideOffset={8}
>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer dark:hover:bg-gray-800 rounded-md"
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
on:click={() => {
downloadTxt();
}}
...
...
@@ -174,7 +174,7 @@
</DropdownMenu.Item>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer dark:hover:bg-gray-800 rounded-md"
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
on:click={() => {
downloadPdf();
}}
...
...
src/lib/components/layout/Sidebar/ChatMenu.svelte
View file @
e6d20df4
...
...
@@ -45,7 +45,7 @@
transition={flyAndScale}
>
<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
hover:bg-gray-50
dark:hover:bg-gray-800
rounded-md"
on:click={() => {
shareHandler();
}}
...
...
@@ -55,7 +55,7 @@
</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
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
on:click={() => {
renameHandler();
}}
...
...
@@ -65,7 +65,7 @@
</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
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
on:click={() => {
archiveChatHandler();
}}
...
...
@@ -75,7 +75,7 @@
</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
hover:bg-gray-50
dark:hover:bg-gray-800 rounded-md"
on:click={() => {
deleteHandler();
}}
...
...
src/lib/components/layout/Sidebar/UserMenu.svelte
View file @
e6d20df4
...
...
@@ -36,7 +36,7 @@
transition={(e) => fade(e, { duration: 100 })}
>
<button
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
10
0 dark:hover:bg-gray-800 transition"
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
5
0 dark:hover:bg-gray-800 transition"
on:click={async () => {
await showSettings.set(true);
show = false;
...
...
@@ -67,7 +67,7 @@
</button>
<button
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
10
0 dark:hover:bg-gray-800 transition"
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
5
0 dark:hover:bg-gray-800 transition"
on:click={() => {
dispatch('show', 'archived-chat');
show = false;
...
...
@@ -81,7 +81,7 @@
{#if role === 'admin'}
<button
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
10
0 dark:hover:bg-gray-800 transition"
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
5
0 dark:hover:bg-gray-800 transition"
on:click={() => {
goto('/admin');
show = false;
...
...
@@ -110,7 +110,7 @@
<hr class=" dark:border-gray-800 my-2 p-0" />
<button
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
10
0 dark:hover:bg-gray-800 transition"
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-
5
0 dark:hover:bg-gray-800 transition"
on:click={() => {
localStorage.removeItem('token');
location.href = '/auth';
...
...
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