mirror of
https://github.com/open-webui/open-webui
synced 2025-06-14 18:33:15 +00:00
refac: styling
This commit is contained in:
parent
aaaef3efd8
commit
13019acce6
@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { modelfiles, settings, showSidebar } from '$lib/stores';
|
||||
import { mobile, modelfiles, settings, showSidebar } from '$lib/stores';
|
||||
import { blobToFile, calculateSHA256, findWordIndices } from '$lib/utils';
|
||||
|
||||
import {
|
||||
@ -765,7 +765,7 @@
|
||||
bind:value={prompt}
|
||||
on:keypress={(e) => {
|
||||
if (
|
||||
window.innerWidth > 1024 ||
|
||||
!$mobile ||
|
||||
!(
|
||||
'ontouchstart' in window ||
|
||||
navigator.maxTouchPoints > 0 ||
|
||||
|
@ -252,6 +252,10 @@
|
||||
const newChatButton = document.getElementById('new-chat-button');
|
||||
setTimeout(() => {
|
||||
newChatButton?.click();
|
||||
|
||||
if ($mobile) {
|
||||
showSidebar.set(false);
|
||||
}
|
||||
}, 0);
|
||||
}}
|
||||
>
|
||||
@ -380,7 +384,7 @@
|
||||
</div>
|
||||
|
||||
{#if $tags.length > 0}
|
||||
<div class="px-2.5 mb-2 flex gap-0.5 flex-wrap">
|
||||
<div class="px-2.5 mb-2 flex gap-1 flex-wrap">
|
||||
<button
|
||||
class="px-2.5 text-xs font-medium bg-gray-50 dark:bg-gray-900 dark:hover:bg-gray-800 transition rounded-full"
|
||||
on:click={async () => {
|
||||
@ -462,7 +466,7 @@
|
||||
href="/c/{chat.id}"
|
||||
on:click={() => {
|
||||
selectedChatId = chat.id;
|
||||
if (window.innerWidth < 1024) {
|
||||
if ($mobile) {
|
||||
showSidebar.set(false);
|
||||
}
|
||||
}}
|
||||
|
@ -82,7 +82,7 @@
|
||||
|
||||
<div class=" text-lg font-semibold mb-3">{$i18n.t('Modelfiles')}</div>
|
||||
|
||||
<a class=" flex space-x-4 cursor-pointer w-full mb-2 px-3 py-2" href="/modelfiles/create">
|
||||
<a class=" flex space-x-4 cursor-pointer w-full mb-2 px-3 py-2" href="/workspace/modelfiles/create">
|
||||
<div class=" self-center w-10">
|
||||
<div
|
||||
class="w-full h-10 flex justify-center rounded-full bg-transparent dark:bg-gray-700 border border-dashed border-gray-200"
|
||||
@ -135,7 +135,7 @@
|
||||
<a
|
||||
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
||||
type="button"
|
||||
href={`/modelfiles/edit?tag=${encodeURIComponent(modelfile.tagName)}`}
|
||||
href={`/workspace/modelfiles/edit?tag=${encodeURIComponent(modelfile.tagName)}`}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -159,7 +159,7 @@
|
||||
on:click={() => {
|
||||
// console.log(modelfile);
|
||||
sessionStorage.modelfile = JSON.stringify(modelfile);
|
||||
goto('/modelfiles/create');
|
||||
goto('/workspace/modelfiles/create');
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
|
@ -74,7 +74,7 @@
|
||||
<div>
|
||||
<a
|
||||
class=" px-2 py-2 rounded-xl border border-gray-200 dark:border-gray-600 dark:border-0 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 transition font-medium text-sm flex items-center space-x-1"
|
||||
href="/prompts/create"
|
||||
href="/workspace/prompts/create"
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -97,7 +97,7 @@
|
||||
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-xl"
|
||||
>
|
||||
<div class=" flex flex-1 space-x-4 cursor-pointer w-full">
|
||||
<a href={`/prompts/edit?command=${encodeURIComponent(prompt.command)}`}>
|
||||
<a href={`/workspace/prompts/edit?command=${encodeURIComponent(prompt.command)}`}>
|
||||
<div class=" flex-1 self-center pl-5">
|
||||
<div class=" font-bold">{prompt.command}</div>
|
||||
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1">
|
||||
@ -110,7 +110,7 @@
|
||||
<a
|
||||
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
||||
type="button"
|
||||
href={`/prompts/edit?command=${encodeURIComponent(prompt.command)}`}
|
||||
href={`/workspace/prompts/edit?command=${encodeURIComponent(prompt.command)}`}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -134,7 +134,7 @@
|
||||
on:click={() => {
|
||||
// console.log(modelfile);
|
||||
sessionStorage.prompt = JSON.stringify(prompt);
|
||||
goto('/prompts/create');
|
||||
goto('/workspace/prompts/create');
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
|
@ -14,7 +14,7 @@
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class=" flex flex-col w-full min-h-screen">
|
||||
<div class=" flex flex-col w-full min-h-screen max-h-screen">
|
||||
<div class=" px-4 pt-3 mt-0.5 mb-1">
|
||||
<div class=" flex items-center gap-1">
|
||||
<div class="{$showSidebar ? 'md:hidden' : ''} mr-1 self-start flex flex-none items-center">
|
||||
@ -39,21 +39,21 @@
|
||||
class="flex scrollbar-none overflow-x-auto w-fit text-center text-sm font-medium rounded-xl bg-transparent/10 p-1"
|
||||
>
|
||||
<a
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname === '/workspace/modelfiles'
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/modelfiles')
|
||||
? 'bg-gray-50 dark:bg-gray-850'
|
||||
: ''} transition"
|
||||
href="/workspace/modelfiles">{$i18n.t('Modelfiles')}</a
|
||||
>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname === '/workspace/prompts'
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/prompts')
|
||||
? 'bg-gray-50 dark:bg-gray-850'
|
||||
: ''} transition"
|
||||
href="/workspace/prompts">{$i18n.t('Prompts')}</a
|
||||
>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname === '/workspace/documents'
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/documents')
|
||||
? 'bg-gray-50 dark:bg-gray-850'
|
||||
: ''} transition"
|
||||
href="/workspace/documents"
|
||||
@ -62,7 +62,7 @@
|
||||
</a>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname === '/workspace/playground'
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/playground')
|
||||
? 'bg-gray-50 dark:bg-gray-850'
|
||||
: ''} transition"
|
||||
href="/workspace/playground">{$i18n.t('Playground')}</a
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
<hr class=" my-2 dark:border-gray-850" />
|
||||
|
||||
<div class=" py-1 px-5 h-full">
|
||||
<div class=" py-1 px-5 flex-1 max-h-full overflow-y-auto">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -204,7 +204,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
categories: Object.keys(categories).filter((category) => categories[category]),
|
||||
user: modelfileCreator !== null ? modelfileCreator : undefined
|
||||
});
|
||||
await goto('/modelfiles');
|
||||
await goto('/workspace/modelfiles');
|
||||
}
|
||||
}
|
||||
loading = false;
|
||||
@ -283,9 +283,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen max-h-[100dvh] w-full flex justify-center dark:text-white">
|
||||
<div class=" flex flex-col justify-between w-full overflow-y-auto">
|
||||
<div class="max-w-2xl mx-auto w-full px-3 md:px-0 my-10">
|
||||
<div class="w-full max-h-full">
|
||||
<input
|
||||
bind:this={filesInputElement}
|
||||
bind:files={inputFiles}
|
||||
@ -351,8 +349,6 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
}}
|
||||
/>
|
||||
|
||||
<div class=" text-2xl font-semibold mb-6">{$i18n.t('My Modelfiles')}</div>
|
||||
|
||||
<button
|
||||
class="flex space-x-1"
|
||||
on:click={() => {
|
||||
@ -375,10 +371,10 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
</div>
|
||||
<div class=" self-center font-medium text-sm">{$i18n.t('Back')}</div>
|
||||
</button>
|
||||
<hr class="my-3 dark:border-gray-700" />
|
||||
<!-- <hr class="my-3 dark:border-gray-700" /> -->
|
||||
|
||||
<form
|
||||
class="flex flex-col"
|
||||
class="flex flex-col max-w-2xl mx-auto mt-4 mb-10"
|
||||
on:submit|preventDefault={() => {
|
||||
submitHandler();
|
||||
}}
|
||||
@ -723,5 +719,3 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,7 +80,7 @@
|
||||
categories[category.toLowerCase()] = true;
|
||||
}
|
||||
} else {
|
||||
goto('/modelfiles');
|
||||
goto('/workspace/modelfiles');
|
||||
}
|
||||
});
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
suggestionPrompts: suggestions.filter((prompt) => prompt.content !== ''),
|
||||
categories: Object.keys(categories).filter((category) => categories[category])
|
||||
});
|
||||
await goto('/modelfiles');
|
||||
await goto('/workspace/modelfiles');
|
||||
}
|
||||
}
|
||||
loading = false;
|
||||
@ -182,9 +182,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen max-h-[100dvh] w-full flex justify-center dark:text-white">
|
||||
<div class="flex flex-col justify-between w-full overflow-y-auto">
|
||||
<div class="max-w-2xl mx-auto w-full px-3 md:px-0 my-10">
|
||||
<div class="w-full max-h-full">
|
||||
<input
|
||||
bind:this={filesInputElement}
|
||||
bind:files={inputFiles}
|
||||
@ -250,8 +248,6 @@
|
||||
}}
|
||||
/>
|
||||
|
||||
<div class=" text-2xl font-semibold mb-6">{$i18n.t('My Modelfiles')}</div>
|
||||
|
||||
<button
|
||||
class="flex space-x-1"
|
||||
on:click={() => {
|
||||
@ -274,10 +270,8 @@
|
||||
</div>
|
||||
<div class=" self-center font-medium text-sm">{$i18n.t('Back')}</div>
|
||||
</button>
|
||||
<hr class="my-3 dark:border-gray-700" />
|
||||
|
||||
<form
|
||||
class="flex flex-col"
|
||||
class="flex flex-col max-w-2xl mx-auto mt-4 mb-10"
|
||||
on:submit|preventDefault={() => {
|
||||
updateHandler();
|
||||
}}
|
||||
@ -511,5 +505,3 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
if (prompt) {
|
||||
await prompts.set(await getPrompts(localStorage.token));
|
||||
await goto('/prompts');
|
||||
await goto('/workspace/prompts');
|
||||
}
|
||||
} else {
|
||||
toast.error(
|
||||
@ -93,11 +93,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen max-h-[100dvh] w-full flex justify-center dark:text-white">
|
||||
<div class=" flex flex-col justify-between w-full overflow-y-auto">
|
||||
<div class="max-w-2xl mx-auto w-full px-3 md:px-0 my-10">
|
||||
<div class=" text-2xl font-semibold mb-6">{$i18n.t('My Prompts')}</div>
|
||||
|
||||
<div class="w-full max-h-full">
|
||||
<button
|
||||
class="flex space-x-1"
|
||||
on:click={() => {
|
||||
@ -120,10 +116,9 @@
|
||||
</div>
|
||||
<div class=" self-center font-medium text-sm">{$i18n.t('Back')}</div>
|
||||
</button>
|
||||
<hr class="my-3 dark:border-gray-700" />
|
||||
|
||||
<form
|
||||
class="flex flex-col"
|
||||
class="flex flex-col max-w-2xl mx-auto mt-4 mb-10"
|
||||
on:submit|preventDefault={() => {
|
||||
submitHandler();
|
||||
}}
|
||||
@ -181,9 +176,7 @@
|
||||
<div>
|
||||
<textarea
|
||||
class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
|
||||
placeholder={$i18n.t(
|
||||
'Write a summary in 50 words that summarizes [topic or keyword].'
|
||||
)}
|
||||
placeholder={$i18n.t('Write a summary in 50 words that summarizes [topic or keyword].')}
|
||||
rows="6"
|
||||
bind:value={content}
|
||||
required
|
||||
@ -250,5 +243,3 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
if (prompt) {
|
||||
await prompts.set(await getPrompts(localStorage.token));
|
||||
await goto('/prompts');
|
||||
await goto('/workspace/prompts');
|
||||
}
|
||||
} else {
|
||||
toast.error(
|
||||
@ -67,19 +67,15 @@
|
||||
command = prompt.command.slice(1);
|
||||
content = prompt.content;
|
||||
} else {
|
||||
goto('/prompts');
|
||||
goto('/workspace/prompts');
|
||||
}
|
||||
} else {
|
||||
goto('/prompts');
|
||||
goto('/workspace/prompts');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen max-h-[100dvh] w-full flex justify-center dark:text-white">
|
||||
<div class="flex flex-col justify-between w-full overflow-y-auto">
|
||||
<div class="max-w-2xl mx-auto w-full px-3 md:px-0 my-10">
|
||||
<div class=" text-2xl font-semibold mb-6">{$i18n.t('My Prompts')}</div>
|
||||
|
||||
<div class="w-full max-h-full">
|
||||
<button
|
||||
class="flex space-x-1"
|
||||
on:click={() => {
|
||||
@ -102,10 +98,9 @@
|
||||
</div>
|
||||
<div class=" self-center font-medium text-sm">{$i18n.t('Back')}</div>
|
||||
</button>
|
||||
<hr class="my-3 dark:border-gray-700" />
|
||||
|
||||
<form
|
||||
class="flex flex-col"
|
||||
class="flex flex-col max-w-2xl mx-auto mt-4 mb-10"
|
||||
on:submit|preventDefault={() => {
|
||||
updateHandler();
|
||||
}}
|
||||
@ -164,9 +159,7 @@
|
||||
<div>
|
||||
<textarea
|
||||
class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
|
||||
placeholder={$i18n.t(
|
||||
`Write a summary in 50 words that summarizes [topic or keyword].`
|
||||
)}
|
||||
placeholder={$i18n.t(`Write a summary in 50 words that summarizes [topic or keyword].`)}
|
||||
rows="6"
|
||||
bind:value={content}
|
||||
required
|
||||
@ -233,5 +226,3 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user