mirror of
https://github.com/open-webui/open-webui
synced 2025-06-10 08:27:55 +00:00
Merge pull request #11423 from silentoplayz/confirmation-prompts
feat: add more confirmation prompts
This commit is contained in:
commit
0dce81f646
@ -5,6 +5,7 @@
|
|||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
|
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||||
|
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import Wrench from '$lib/components/icons/Wrench.svelte';
|
import Wrench from '$lib/components/icons/Wrench.svelte';
|
||||||
@ -20,6 +21,7 @@
|
|||||||
|
|
||||||
let showManageModal = false;
|
let showManageModal = false;
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
|
let showDeleteConfirmDialog = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
@ -31,7 +33,9 @@
|
|||||||
key: config?.key ?? '',
|
key: config?.key ?? '',
|
||||||
config: config
|
config: config
|
||||||
}}
|
}}
|
||||||
{onDelete}
|
onDelete={() => {
|
||||||
|
showDeleteConfirmDialog = true;
|
||||||
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
config = { ...connection.config, key: connection.key };
|
config = { ...connection.config, key: connection.key };
|
||||||
@ -39,6 +43,14 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
bind:show={showDeleteConfirmDialog}
|
||||||
|
on:confirm={() => {
|
||||||
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<ManageOllamaModal bind:show={showManageModal} urlIdx={idx} />
|
<ManageOllamaModal bind:show={showManageModal} urlIdx={idx} />
|
||||||
|
|
||||||
<div class="flex gap-1.5">
|
<div class="flex gap-1.5">
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
|
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||||
|
|
||||||
import { connect } from 'socket.io-client';
|
import { connect } from 'socket.io-client';
|
||||||
|
|
||||||
@ -19,8 +20,16 @@
|
|||||||
export let config = {};
|
export let config = {};
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
|
let showDeleteConfirmDialog = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
bind:show={showDeleteConfirmDialog}
|
||||||
|
on:confirm={() => {
|
||||||
|
onDelete();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
edit
|
edit
|
||||||
bind:show={showConfigModal}
|
bind:show={showConfigModal}
|
||||||
@ -29,7 +38,9 @@
|
|||||||
key,
|
key,
|
||||||
config
|
config
|
||||||
}}
|
}}
|
||||||
{onDelete}
|
onDelete={() => {
|
||||||
|
showDeleteConfirmDialog = true;
|
||||||
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
key = connection.key;
|
key = connection.key;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import PencilSolid from '$lib/components/icons/PencilSolid.svelte';
|
import PencilSolid from '$lib/components/icons/PencilSolid.svelte';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import AccessControl from '$lib/components/workspace/common/AccessControl.svelte';
|
import AccessControl from '$lib/components/workspace/common/AccessControl.svelte';
|
||||||
|
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||||
|
|
||||||
export let show = false;
|
export let show = false;
|
||||||
export let edit = false;
|
export let edit = false;
|
||||||
@ -44,6 +45,7 @@
|
|||||||
|
|
||||||
let imageInputElement;
|
let imageInputElement;
|
||||||
let loading = false;
|
let loading = false;
|
||||||
|
let showDeleteConfirmDialog = false;
|
||||||
|
|
||||||
const addModelHandler = () => {
|
const addModelHandler = () => {
|
||||||
if (selectedModelId) {
|
if (selectedModelId) {
|
||||||
@ -115,6 +117,14 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
bind:show={showDeleteConfirmDialog}
|
||||||
|
on:confirm={() => {
|
||||||
|
dispatch('delete', model);
|
||||||
|
show = false;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<Modal size="sm" bind:show>
|
<Modal size="sm" bind:show>
|
||||||
<div>
|
<div>
|
||||||
<div class=" flex justify-between dark:text-gray-100 px-5 pt-4 pb-2">
|
<div class=" flex justify-between dark:text-gray-100 px-5 pt-4 pb-2">
|
||||||
@ -378,8 +388,7 @@
|
|||||||
class="px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-950 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center"
|
class="px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-950 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center"
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
dispatch('delete', model);
|
showDeleteConfirmDialog = true;
|
||||||
show = false;
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$i18n.t('Delete')}
|
{$i18n.t('Delete')}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
import Modal from '$lib/components/common/Modal.svelte';
|
import Modal from '$lib/components/common/Modal.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 ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
@ -19,6 +20,8 @@
|
|||||||
export let user;
|
export let user;
|
||||||
|
|
||||||
let chats = null;
|
let chats = null;
|
||||||
|
let showDeleteConfirmDialog = false;
|
||||||
|
let chatToDelete = null;
|
||||||
|
|
||||||
const deleteChatHandler = async (chatId) => {
|
const deleteChatHandler = async (chatId) => {
|
||||||
const res = await deleteChatById(localStorage.token, chatId).catch((error) => {
|
const res = await deleteChatById(localStorage.token, chatId).catch((error) => {
|
||||||
@ -50,6 +53,16 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
bind:show={showDeleteConfirmDialog}
|
||||||
|
on:confirm={() => {
|
||||||
|
if (chatToDelete) {
|
||||||
|
deleteChatHandler(chatToDelete);
|
||||||
|
chatToDelete = null;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<Modal size="lg" bind:show>
|
<Modal size="lg" bind:show>
|
||||||
<div class=" flex justify-between dark:text-gray-300 px-5 pt-4">
|
<div class=" flex justify-between dark:text-gray-300 px-5 pt-4">
|
||||||
<div class=" text-lg font-medium self-center capitalize">
|
<div class=" text-lg font-medium self-center capitalize">
|
||||||
@ -142,7 +155,8 @@
|
|||||||
<button
|
<button
|
||||||
class="self-center w-fit text-sm px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
class="self-center w-fit text-sm px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
deleteChatHandler(chat.id);
|
chatToDelete = chat.id;
|
||||||
|
showDeleteConfirmDialog = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
|
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||||
|
|
||||||
export let onDelete = () => {};
|
export let onDelete = () => {};
|
||||||
export let onSubmit = () => {};
|
export let onSubmit = () => {};
|
||||||
@ -17,6 +18,7 @@
|
|||||||
export let config = {};
|
export let config = {};
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
|
let showDeleteConfirmDialog = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
@ -28,7 +30,9 @@
|
|||||||
key,
|
key,
|
||||||
config
|
config
|
||||||
}}
|
}}
|
||||||
{onDelete}
|
onDelete={() => {
|
||||||
|
showDeleteConfirmDialog = true;
|
||||||
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
key = connection.key;
|
key = connection.key;
|
||||||
@ -37,6 +41,14 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
bind:show={showDeleteConfirmDialog}
|
||||||
|
on:confirm={() => {
|
||||||
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="flex w-full gap-2 items-center">
|
<div class="flex w-full gap-2 items-center">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
className="w-full relative"
|
className="w-full relative"
|
||||||
|
Loading…
Reference in New Issue
Block a user