open-webui/src/routes/(app)/playground/+layout.svelte

77 lines
2.1 KiB
Svelte
Raw Normal View History

2024-06-24 20:11:49 +00:00
<script lang="ts">
import { onMount, getContext } from 'svelte';
import { WEBUI_NAME, showSidebar, functions } from '$lib/stores';
import MenuLines from '$lib/components/icons/MenuLines.svelte';
import { page } from '$app/stores';
const i18n = getContext('i18n');
onMount(async () => {});
</script>
<svelte:head>
<title>
{$i18n.t('Playground')} | {$WEBUI_NAME}
</title>
</svelte:head>
<div
2024-11-04 07:05:41 +00:00
class=" flex flex-col w-full h-screen max-h-[100dvh] {$showSidebar
2024-06-24 20:11:49 +00:00
? 'md:max-w-[calc(100%-260px)]'
: ''}"
>
2024-11-07 06:52:06 +00:00
<div class=" px-2.5 py-1 backdrop-blur-xl">
2024-11-07 05:13:37 +00:00
<div class=" flex items-center">
<div class="{$showSidebar ? 'md:hidden' : ''} flex flex-none items-center">
2024-06-24 20:11:49 +00:00
<button
id="sidebar-toggle-button"
2024-10-21 12:09:28 +00:00
class="cursor-pointer p-1.5 flex rounded-xl hover:bg-gray-100 dark:hover:bg-gray-850 transition"
2024-06-24 20:11:49 +00:00
on:click={() => {
showSidebar.set(!$showSidebar);
}}
aria-label="Toggle Sidebar"
2024-06-24 20:11:49 +00:00
>
<div class=" m-auto self-center">
<MenuLines />
</div>
</button>
</div>
2024-10-21 12:09:28 +00:00
<div class=" flex w-full">
<div
2024-11-07 05:45:48 +00:00
class="flex gap-1 scrollbar-none overflow-x-auto w-fit text-center text-sm font-medium rounded-full bg-transparent py-1"
2024-10-21 12:09:28 +00:00
>
<a
2024-11-07 05:13:37 +00:00
class="min-w-fit rounded-full p-1.5 {['/playground', '/playground/'].includes(
2024-10-21 12:09:28 +00:00
$page.url.pathname
)
2024-11-07 05:13:37 +00:00
? ''
2024-11-11 21:56:33 +00:00
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
2024-10-21 12:09:28 +00:00
href="/playground">{$i18n.t('Chat')}</a
>
2024-11-13 00:08:18 +00:00
<!-- <a
2024-11-07 05:13:37 +00:00
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes('/playground/notes')
? ''
2024-11-11 21:56:33 +00:00
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
2024-10-26 07:21:46 +00:00
href="/playground/notes">{$i18n.t('Notes')}</a
2024-11-13 00:08:18 +00:00
> -->
2024-10-26 07:21:46 +00:00
2024-10-21 12:09:28 +00:00
<a
2024-11-07 05:13:37 +00:00
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes(
2024-10-21 12:09:28 +00:00
'/playground/completions'
)
2024-11-07 05:13:37 +00:00
? ''
2024-11-11 21:56:33 +00:00
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
2024-10-21 12:09:28 +00:00
href="/playground/completions">{$i18n.t('Completions')}</a
>
</div>
2024-10-21 06:53:36 +00:00
</div>
2024-06-24 20:11:49 +00:00
</div>
</div>
2024-10-21 22:24:59 +00:00
<div class=" flex-1 max-h-full overflow-y-auto">
2024-06-24 20:11:49 +00:00
<slot />
</div>
</div>