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
61e0a85a
Commit
61e0a85a
authored
Jun 11, 2024
by
Timothy J. Baek
Browse files
feat: export tool
parent
e483c6b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
80 deletions
+112
-80
src/lib/components/workspace/Tools.svelte
src/lib/components/workspace/Tools.svelte
+112
-80
No files found.
src/lib/components/workspace/Tools.svelte
View file @
61e0a85a
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
getToolById,
getToolById,
getTools
getTools
} from '$lib/apis/tools';
} from '$lib/apis/tools';
import ArrowDownTray from '../icons/ArrowDownTray.svelte';
import Tooltip from '../common/Tooltip.svelte';
const i18n = getContext('i18n');
const i18n = getContext('i18n');
...
@@ -107,6 +109,7 @@
...
@@ -107,6 +109,7 @@
</a>
</a>
</div>
</div>
<div class="flex flex-row space-x-1 self-center">
<div class="flex flex-row space-x-1 self-center">
<Tooltip content="Edit">
<a
<a
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"
...
@@ -127,7 +130,9 @@
...
@@ -127,7 +130,9 @@
/>
/>
</svg>
</svg>
</a>
</a>
</Tooltip>
<Tooltip content="Clone">
<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"
...
@@ -164,7 +169,33 @@
...
@@ -164,7 +169,33 @@
/>
/>
</svg>
</svg>
</button>
</button>
</Tooltip>
<Tooltip content="Export">
<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"
type="button"
on:click={async (e) => {
e.stopPropagation();
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
return null;
});
if (_tool) {
let blob = new Blob([JSON.stringify([_tool])], {
type: 'application/json'
});
saveAs(blob, `tool-${_tool.id}-export-${Date.now()}.json`);
}
}}
>
<ArrowDownTray />
</button>
</Tooltip>
<Tooltip content="Delete">
<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"
...
@@ -197,6 +228,7 @@
...
@@ -197,6 +228,7 @@
/>
/>
</svg>
</svg>
</button>
</button>
</Tooltip>
</div>
</div>
</button>
</button>
{/each}
{/each}
...
...
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