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
fc465329
Commit
fc465329
authored
Jun 11, 2024
by
Timothy J. Baek
Browse files
fix
parent
5f29a9ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
src/lib/components/workspace/Tools.svelte
src/lib/components/workspace/Tools.svelte
+3
-1
src/routes/(app)/workspace/tools/create/+page.svelte
src/routes/(app)/workspace/tools/create/+page.svelte
+17
-12
No files found.
src/lib/components/workspace/Tools.svelte
View file @
fc465329
...
@@ -131,7 +131,9 @@
...
@@ -131,7 +131,9 @@
<button
<button
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
type="button"
on:click={async () => {
on:click={async (e) => {
e.stopPropagation();
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
toast.error(error);
return null;
return null;
...
...
src/routes/(app)/workspace/tools/create/+page.svelte
View file @
fc465329
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import { onMount } from 'svelte';
import { onMount } from 'svelte';
import { toast } from 'svelte-sonner';
import { toast } from 'svelte-sonner';
let mounted = false;
let clone = false;
let clone = false;
let tool = null;
let tool = null;
...
@@ -30,17 +31,20 @@
...
@@ -30,17 +31,20 @@
};
};
onMount(() => {
onMount(() => {
console.log('mounted');
if (sessionStorage.tool) {
if (sessionStorage.tool) {
tool = JSON.parse(sessionStorage.tool);
tool = JSON.parse(sessionStorage.tool);
sessionStorage.removeItem('tool');
sessionStorage.removeItem('tool');
console.log(tool);
clone = true;
clone = true;
}
}
mounted = true;
});
});
</script>
</script>
<ToolkitEditor
{#if mounted}
<ToolkitEditor
id={tool?.id ?? ''}
id={tool?.id ?? ''}
name={tool?.name ?? ''}
name={tool?.name ?? ''}
meta={tool?.meta ?? { description: '' }}
meta={tool?.meta ?? { description: '' }}
...
@@ -49,4 +53,5 @@
...
@@ -49,4 +53,5 @@
on:save={(e) => {
on:save={(e) => {
saveHandler(e.detail);
saveHandler(e.detail);
}}
}}
/>
/>
{/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