mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-09 07:00:06 +00:00
Add default confirm dialog (#2114)
This commit is contained in:
@@ -13,7 +13,14 @@
|
||||
autofocus
|
||||
/>
|
||||
<Button
|
||||
v-if="type === 'delete'"
|
||||
v-if="type === 'default'"
|
||||
:label="$t('g.confirm')"
|
||||
severity="primary"
|
||||
@click="onConfirm"
|
||||
icon="pi pi-check"
|
||||
/>
|
||||
<Button
|
||||
v-else-if="type === 'delete'"
|
||||
:label="$t('g.delete')"
|
||||
severity="danger"
|
||||
@click="onConfirm"
|
||||
|
||||
@@ -12,6 +12,7 @@ import type { ExecutionErrorWsMessage } from '@/types/apiTypes'
|
||||
import type { MissingNodeType } from '@/types/comfy'
|
||||
|
||||
export type ConfirmationDialogType =
|
||||
| 'default'
|
||||
| 'overwrite'
|
||||
| 'delete'
|
||||
| 'dirtyClose'
|
||||
@@ -121,16 +122,16 @@ export const useDialogService = () => {
|
||||
*/
|
||||
async function confirm({
|
||||
title,
|
||||
type,
|
||||
message,
|
||||
type = 'default',
|
||||
itemList = []
|
||||
}: {
|
||||
/** Dialog heading */
|
||||
title: string
|
||||
/** Pre-configured dialog type */
|
||||
type: ConfirmationDialogType
|
||||
/** The main message body */
|
||||
message: string
|
||||
/** Pre-configured dialog type */
|
||||
type?: ConfirmationDialogType
|
||||
/** Displayed as an unorderd list immediately below the message body */
|
||||
itemList?: string[]
|
||||
}): Promise<boolean | null> {
|
||||
|
||||
Reference in New Issue
Block a user