refac: move functions (plugin) to admin panel
This commit is contained in:
@@ -65,6 +65,13 @@
|
||||
href="/admin/evaluations">{$i18n.t('Evaluations')}</a
|
||||
>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-full 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"
|
||||
href="/admin/functions">{$i18n.t('Functions')}</a
|
||||
>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes('/admin/settings')
|
||||
? ''
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
import { functions } from '$lib/stores';
|
||||
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import Functions from '$lib/components/workspace/Functions.svelte';
|
||||
import Functions from '$lib/components/admin/Functions.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
import { functions, models } from '$lib/stores';
|
||||
import { createNewFunction, getFunctions } from '$lib/apis/functions';
|
||||
import FunctionEditor from '$lib/components/workspace/Functions/FunctionEditor.svelte';
|
||||
import FunctionEditor from '$lib/components/admin/Functions/FunctionEditor.svelte';
|
||||
import { getModels } from '$lib/apis';
|
||||
import { compareVersion, extractFrontmatter } from '$lib/utils';
|
||||
import { WEBUI_VERSION } from '$lib/constants';
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
import { functions, models } from '$lib/stores';
|
||||
import { updateFunctionById, getFunctions, getFunctionById } from '$lib/apis/functions';
|
||||
|
||||
import FunctionEditor from '$lib/components/workspace/Functions/FunctionEditor.svelte';
|
||||
import FunctionEditor from '$lib/components/admin/Functions/FunctionEditor.svelte';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
import { getModels } from '$lib/apis';
|
||||
import { compareVersion, extractFrontmatter } from '$lib/utils';
|
||||
@@ -82,27 +82,14 @@
|
||||
href="/workspace/prompts">{$i18n.t('Prompts')}</a
|
||||
>
|
||||
|
||||
{#if $user?.role === 'admin'}
|
||||
<a
|
||||
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes('/workspace/tools')
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
||||
href="/workspace/tools"
|
||||
>
|
||||
{$i18n.t('Tools')}
|
||||
</a>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes(
|
||||
'/workspace/functions'
|
||||
)
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
||||
href="/workspace/functions"
|
||||
>
|
||||
{$i18n.t('Functions')}
|
||||
</a>
|
||||
{/if}
|
||||
<a
|
||||
class="min-w-fit rounded-full p-1.5 {$page.url.pathname.includes('/workspace/tools')
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
||||
href="/workspace/tools"
|
||||
>
|
||||
{$i18n.t('Tools')}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user