From 947444949a999fb31af7ea4a42f12cb0d2f62f40 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 14 Nov 2024 18:32:23 -0800 Subject: [PATCH] refac: move functions (plugin) to admin panel --- .../{workspace => admin}/Functions.svelte | 13 ++++----- .../Functions/FunctionEditor.svelte | 2 +- .../Functions/FunctionMenu.svelte | 0 src/lib/components/workspace/Tools.svelte | 6 ---- src/routes/(app)/admin/+layout.svelte | 7 +++++ .../functions/+page.svelte | 2 +- .../functions/create/+page.svelte | 2 +- .../functions/edit/+page.svelte | 2 +- src/routes/(app)/workspace/+layout.svelte | 29 +++++-------------- 9 files changed, 25 insertions(+), 38 deletions(-) rename src/lib/components/{workspace => admin}/Functions.svelte (97%) rename src/lib/components/{workspace => admin}/Functions/FunctionEditor.svelte (99%) rename src/lib/components/{workspace => admin}/Functions/FunctionMenu.svelte (100%) rename src/routes/(app)/{workspace => admin}/functions/+page.svelte (83%) rename src/routes/(app)/{workspace => admin}/functions/create/+page.svelte (96%) rename src/routes/(app)/{workspace => admin}/functions/edit/+page.svelte (96%) diff --git a/src/lib/components/workspace/Functions.svelte b/src/lib/components/admin/Functions.svelte similarity index 97% rename from src/lib/components/workspace/Functions.svelte rename to src/lib/components/admin/Functions.svelte index 08e1e28a1..ff1006e55 100644 --- a/src/lib/components/workspace/Functions.svelte +++ b/src/lib/components/admin/Functions.svelte @@ -5,7 +5,6 @@ import { WEBUI_NAME, config, functions, models } from '$lib/stores'; import { onMount, getContext, tick } from 'svelte'; - import { createNewPrompt, deletePromptByCommand, getPrompts } from '$lib/apis/prompts'; import { goto } from '$app/navigation'; import { @@ -25,8 +24,8 @@ import FunctionMenu from './Functions/FunctionMenu.svelte'; import EllipsisHorizontal from '../icons/EllipsisHorizontal.svelte'; import Switch from '../common/Switch.svelte'; - import ValvesModal from './common/ValvesModal.svelte'; - import ManifestModal from './common/ManifestModal.svelte'; + import ValvesModal from '../workspace/common/ValvesModal.svelte'; + import ManifestModal from '../workspace/common/ManifestModal.svelte'; import Heart from '../icons/Heart.svelte'; import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import GarbageBin from '../icons/GarbageBin.svelte'; @@ -98,7 +97,7 @@ id: `${_function.id}_clone`, name: `${_function.name} (Clone)` }); - goto('/workspace/functions/create'); + goto('/admin/functions/create'); } }; @@ -210,7 +209,7 @@
@@ -225,7 +224,7 @@ >
@@ -322,7 +321,7 @@ { - goto(`/workspace/functions/edit?id=${encodeURIComponent(func.id)}`); + goto(`/admin/functions/edit?id=${encodeURIComponent(func.id)}`); }} shareHandler={() => { shareHandler(func); diff --git a/src/lib/components/workspace/Functions/FunctionEditor.svelte b/src/lib/components/admin/Functions/FunctionEditor.svelte similarity index 99% rename from src/lib/components/workspace/Functions/FunctionEditor.svelte rename to src/lib/components/admin/Functions/FunctionEditor.svelte index 63f8951e5..187110be0 100644 --- a/src/lib/components/workspace/Functions/FunctionEditor.svelte +++ b/src/lib/components/admin/Functions/FunctionEditor.svelte @@ -305,7 +305,7 @@ class Pipe:
-
- ⓘ {$i18n.t( - 'Admins have access to all tools at all times; users need tools assigned per model in the workspace.' - )} -
-