mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 12:35:55 +02:00
refac
This commit is contained in:
@@ -15,6 +15,11 @@
|
||||
onMount(async () => {
|
||||
if ($user?.role !== 'admin') {
|
||||
await goto('/');
|
||||
} else if (
|
||||
!$config?.features?.enable_plugins &&
|
||||
$page.url.pathname.includes('/admin/functions')
|
||||
) {
|
||||
await goto('/admin');
|
||||
}
|
||||
loaded = true;
|
||||
});
|
||||
@@ -85,13 +90,15 @@
|
||||
href="/admin/evaluations">{$i18n.t('Evaluations')}</a
|
||||
>
|
||||
|
||||
<a
|
||||
draggable="false"
|
||||
class="min-w-fit p-1.5 {$page.url.pathname.includes('/admin/functions')
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition select-none"
|
||||
href="/admin/functions">{$i18n.t('Functions')}</a
|
||||
>
|
||||
{#if $config?.features?.enable_plugins}
|
||||
<a
|
||||
draggable="false"
|
||||
class="min-w-fit p-1.5 {$page.url.pathname.includes('/admin/functions')
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition select-none"
|
||||
href="/admin/functions">{$i18n.t('Functions')}</a
|
||||
>
|
||||
{/if}
|
||||
|
||||
<a
|
||||
draggable="false"
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { functions } from '$lib/stores';
|
||||
import { config, functions } from '$lib/stores';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import Functions from '$lib/components/admin/Functions.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
if (!$config?.features?.enable_plugins) {
|
||||
await goto('/admin');
|
||||
return;
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
functions.set(await getFunctions(localStorage.token));
|
||||
|
||||
@@ -61,6 +61,11 @@
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
if (!$config?.features?.enable_plugins) {
|
||||
goto('/admin');
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('message', async (event) => {
|
||||
if (
|
||||
!['https://openwebui.com', 'https://www.openwebui.com', 'http://localhost:9999'].includes(
|
||||
|
||||
@@ -60,6 +60,11 @@
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
if (!$config?.features?.enable_plugins) {
|
||||
goto('/admin');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('mounted');
|
||||
const id = $page.url.searchParams.get('id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user