Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
25c0eca4
Commit
25c0eca4
authored
Jun 10, 2024
by
Timothy J. Baek
Browse files
feat: edit tool spinner
parent
ca8be1ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
src/lib/components/workspace/Tools.svelte
src/lib/components/workspace/Tools.svelte
+5
-2
src/lib/components/workspace/Tools/ToolkitEditor.svelte
src/lib/components/workspace/Tools/ToolkitEditor.svelte
+2
-2
src/routes/(app)/workspace/tools/edit/+page.svelte
src/routes/(app)/workspace/tools/edit/+page.svelte
+7
-0
No files found.
src/lib/components/workspace/Tools.svelte
View file @
25c0eca4
...
@@ -77,9 +77,12 @@
...
@@ -77,9 +77,12 @@
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-xl"
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-xl"
>
>
<div class=" flex flex-1 space-x-4 cursor-pointer w-full">
<div class=" flex flex-1 space-x-4 cursor-pointer w-full">
<a href={`/workspace/tools/edit?id=${encodeURIComponent(tool.id)}`}>
<a
href={`/workspace/tools/edit?id=${encodeURIComponent(tool.id)}`}
class="flex items-center"
>
<div class=" flex-1 self-center pl-5">
<div class=" flex-1 self-center pl-5">
<div class=" font-bold flex items-center gap-1.5">
<div class=" font-
semi
bold flex items-center gap-1.5">
<div>
<div>
{tool.name}
{tool.name}
</div>
</div>
...
...
src/lib/components/workspace/Tools/ToolkitEditor.svelte
View file @
25c0eca4
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
};
};
export let content = '';
export let content = '';
$: if (name) {
$: if (name
&& !edit
) {
id = name.replace(/\s+/g, '_').toLowerCase();
id = name.replace(/\s+/g, '_').toLowerCase();
}
}
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
/>
/>
<input
<input
class="w-full px-3 py-2 text-sm font-medium bg-gray-50 dark:bg-gray-850 dark:text-gray-200 rounded-lg outline-none"
class="w-full px-3 py-2 text-sm font-medium
disabled:text-gray-300 dark:disabled:text-gray-700
bg-gray-50 dark:bg-gray-850 dark:text-gray-200 rounded-lg outline-none"
type="text"
type="text"
placeholder="Toolkit ID (e.g. my_toolkit)"
placeholder="Toolkit ID (e.g. my_toolkit)"
bind:value={id}
bind:value={id}
...
...
src/routes/(app)/workspace/tools/edit/+page.svelte
View file @
25c0eca4
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import { goto } from '$app/navigation';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { page } from '$app/stores';
import { getToolById, getTools, updateToolById } from '$lib/apis/tools';
import { getToolById, getTools, updateToolById } from '$lib/apis/tools';
import Spinner from '$lib/components/common/Spinner.svelte';
import ToolkitEditor from '$lib/components/workspace/Tools/ToolkitEditor.svelte';
import ToolkitEditor from '$lib/components/workspace/Tools/ToolkitEditor.svelte';
import { tools } from '$lib/stores';
import { tools } from '$lib/stores';
import { onMount } from 'svelte';
import { onMount } from 'svelte';
...
@@ -54,4 +55,10 @@
...
@@ -54,4 +55,10 @@
saveHandler(e.detail);
saveHandler(e.detail);
}}
}}
/>
/>
{:else}
<div class="flex items-center justify-center h-full">
<div class=" pb-16">
<Spinner />
</div>
</div>
{/if}
{/if}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment