"...linux/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "565f8d417ec8d210c277021752ebd72cd4f179f5"
Commit a0dbc970 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

enh: model delete confirmation

parent 2abb6788
<script lang="ts"> <script lang="ts">
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner';
import { onMount, getContext } from 'svelte';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { WEBUI_NAME, models, MODEL_DOWNLOAD_POOL, user, config } from '$lib/stores';
import { splitStream } from '$lib/utils';
import { import {
createModel, createModel,
...@@ -11,15 +16,11 @@ ...@@ -11,15 +16,11 @@
uploadModel, uploadModel,
getOllamaConfig getOllamaConfig
} from '$lib/apis/ollama'; } from '$lib/apis/ollama';
import { getModels as _getModels } from '$lib/apis';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { WEBUI_NAME, models, MODEL_DOWNLOAD_POOL, user, config } from '$lib/stores';
import { splitStream } from '$lib/utils';
import { onMount, getContext } from 'svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte';
import Spinner from '$lib/components/common/Spinner.svelte'; import Spinner from '$lib/components/common/Spinner.svelte';
import { getModels as _getModels } from '$lib/apis'; import ModelDeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
let modelUploadInputElement: HTMLInputElement; let modelUploadInputElement: HTMLInputElement;
let showModelDeleteConfirm = false;
// Models // Models
let ollamaEnabled = null; let ollamaEnabled = null;
...@@ -549,6 +552,13 @@ ...@@ -549,6 +552,13 @@
}); });
</script> </script>
<ModelDeleteConfirmDialog
bind:show={showModelDeleteConfirm}
on:confirm={() => {
deleteModelHandler();
}}
/>
<div class="flex flex-col h-full justify-between text-sm"> <div class="flex flex-col h-full justify-between text-sm">
<div class=" space-y-3 overflow-y-scroll scrollbar-hidden h-full"> <div class=" space-y-3 overflow-y-scroll scrollbar-hidden h-full">
{#if ollamaEnabled} {#if ollamaEnabled}
...@@ -763,7 +773,7 @@ ...@@ -763,7 +773,7 @@
<button <button
class="px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition" class="px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"
on:click={() => { on:click={() => {
deleteModelHandler(); showModelDeleteConfirm = true;
}} }}
> >
<svg <svg
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment