"example/38_permute/permute_NxHxW_fp16.cpp" did not exist on "18ba135ff1a16bd7586d2e763a79236390422510"
Commit c6d7f245 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: block users from /workspace and /admin

parent 4c1a9380
<script lang="ts">
import { onMount, getContext } from 'svelte';
import { goto } from '$app/navigation';
import { WEBUI_NAME, showSidebar } from '$lib/stores';
import { WEBUI_NAME, showSidebar, user } from '$lib/stores';
import MenuLines from '$lib/components/icons/MenuLines.svelte';
import { page } from '$app/stores';
const i18n = getContext('i18n');
let loaded = false;
onMount(async () => {
if ($user?.role !== 'admin') {
await goto('/');
}
loaded = true;
});
</script>
<svelte:head>
......@@ -14,11 +24,12 @@
</title>
</svelte:head>
<div
{#if loaded}
<div
class=" flex flex-col w-full min-h-screen max-h-screen {$showSidebar
? 'md:max-w-[calc(100%-260px)]'
: ''}"
>
>
<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">
......@@ -79,4 +90,5 @@
<div class=" py-1 px-5 flex-1 max-h-full overflow-y-auto">
<slot />
</div>
</div>
</div>
{/if}
<script lang="ts">
import { onMount, getContext } from 'svelte';
import { WEBUI_NAME, showSidebar, functions, user } from '$lib/stores';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { WEBUI_NAME, showSidebar, functions } from '$lib/stores';
import MenuLines from '$lib/components/icons/MenuLines.svelte';
import { page } from '$app/stores';
import { getFunctions } from '$lib/apis/functions';
const i18n = getContext('i18n');
let loaded = false;
onMount(async () => {
// functions.set(await getFunctions(localStorage.token));
if ($user?.role !== 'admin') {
await goto('/');
}
loaded = true;
});
</script>
......@@ -19,11 +24,12 @@
</title>
</svelte:head>
<div
{#if loaded}
<div
class=" flex flex-col w-full min-h-screen max-h-screen {$showSidebar
? 'md:max-w-[calc(100%-260px)]'
: ''}"
>
>
<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">
......@@ -62,7 +68,9 @@
>
<a
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/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"
......@@ -80,7 +88,9 @@
</a>
<a
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/functions')
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes(
'/workspace/functions'
)
? 'bg-gray-50 dark:bg-gray-850'
: ''} transition"
href="/workspace/functions"
......@@ -95,4 +105,5 @@
<div class=" py-1 px-5 flex-1 max-h-full overflow-y-auto">
<slot />
</div>
</div>
</div>
{/if}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment