diff --git a/src/lib/components/workspace/Functions.svelte b/src/lib/components/workspace/Functions.svelte index b3572a087..78f925391 100644 --- a/src/lib/components/workspace/Functions.svelte +++ b/src/lib/components/workspace/Functions.svelte @@ -27,6 +27,7 @@ import ValvesModal from './common/ValvesModal.svelte'; import ManifestModal from './common/ManifestModal.svelte'; import Heart from '../icons/Heart.svelte'; + import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; const i18n = getContext('i18n'); @@ -40,6 +41,8 @@ let showValvesModal = false; let selectedFunction = null; + let showDeleteConfirm = false; + const shareHandler = async (tool) => { console.log(tool); }; @@ -246,7 +249,8 @@ exportHandler(func); }} deleteHandler={async () => { - deleteHandler(func); + selectedFunction = func; + showDeleteConfirm = true; }} onClose={() => {}} > @@ -386,6 +390,18 @@ + { + deleteHandler(selectedFunction); + }} +> +
+ {$i18n.t('This will delete')} {selectedFunction.name}. +
+
+ { toast.success($i18n.t('Redirecting you to OpenWebUI Community')); @@ -155,7 +159,8 @@ exportHandler(prompt); }} deleteHandler={async () => { - deleteHandler(prompt); + deletePrompt = prompt; + showDeleteConfirm = true; }} onClose={() => {}} > @@ -301,3 +306,15 @@ + + { + deleteHandler(deletePrompt); + }} +> +
+ {$i18n.t('This will delete')} {deletePrompt.command}. +
+
diff --git a/src/lib/components/workspace/Tools.svelte b/src/lib/components/workspace/Tools.svelte index c98c013fb..5920b34f5 100644 --- a/src/lib/components/workspace/Tools.svelte +++ b/src/lib/components/workspace/Tools.svelte @@ -23,6 +23,7 @@ import ValvesModal from './common/ValvesModal.svelte'; import ManifestModal from './common/ManifestModal.svelte'; import Heart from '../icons/Heart.svelte'; + import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; const i18n = getContext('i18n'); @@ -36,6 +37,8 @@ let showValvesModal = false; let selectedTool = null; + let showDeleteConfirm = false; + const shareHandler = async (tool) => { console.log(tool); }; @@ -240,7 +243,8 @@ exportHandler(tool); }} deleteHandler={async () => { - deleteHandler(tool); + selectedTool = tool; + showDeleteConfirm = true; }} onClose={() => {}} > @@ -370,6 +374,18 @@ + { + deleteHandler(selectedTool); + }} +> +
+ {$i18n.t('This will delete')} {selectedTool.name}. +
+
+