mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
refactor: replace dialogService method call with useWorkflowTemplateSelectorDialog hook
This commit is contained in:
@@ -45,6 +45,8 @@ import {
|
|||||||
} from '@/utils/graphTraversalUtil'
|
} from '@/utils/graphTraversalUtil'
|
||||||
import { filterOutputNodes } from '@/utils/nodeFilterUtil'
|
import { filterOutputNodes } from '@/utils/nodeFilterUtil'
|
||||||
|
|
||||||
|
import { useWorkflowTemplateSelectorDialog } from './useWorkflowTemplateSelectorDialog'
|
||||||
|
|
||||||
const moveSelectedNodesVersionAdded = '1.22.2'
|
const moveSelectedNodesVersionAdded = '1.22.2'
|
||||||
|
|
||||||
export function useCoreCommands(): ComfyCommand[] {
|
export function useCoreCommands(): ComfyCommand[] {
|
||||||
@@ -251,7 +253,7 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
icon: 'pi pi-folder-open',
|
icon: 'pi pi-folder-open',
|
||||||
label: 'Browse Templates',
|
label: 'Browse Templates',
|
||||||
function: () => {
|
function: () => {
|
||||||
dialogService.showWorkflowTemplateSelectorDialog()
|
useWorkflowTemplateSelectorDialog().show()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ export const useWorkflowTemplateSelectorDialog = () => {
|
|||||||
component: NewWorkflowTemplateSelectorDialog,
|
component: NewWorkflowTemplateSelectorDialog,
|
||||||
props: {
|
props: {
|
||||||
onClose: hide
|
onClose: hide
|
||||||
|
},
|
||||||
|
dialogComponentProps: {
|
||||||
|
pt: {
|
||||||
|
content: { class: '!px-0 overflow-hidden h-full !py-0' },
|
||||||
|
root: {
|
||||||
|
style:
|
||||||
|
'width: 90vw; height: 85vh; max-width: 1400px; display: flex;'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { merge } from 'es-toolkit/compat'
|
import { merge } from 'es-toolkit/compat'
|
||||||
import { Component } from 'vue'
|
import { Component } from 'vue'
|
||||||
|
|
||||||
import NewWorkflowTemplateSelectorDialog from '@/components/custom/widget/NewWorkflowTemplateSelectorDialog.vue'
|
|
||||||
import ApiNodesSignInContent from '@/components/dialog/content/ApiNodesSignInContent.vue'
|
import ApiNodesSignInContent from '@/components/dialog/content/ApiNodesSignInContent.vue'
|
||||||
import ConfirmationDialogContent from '@/components/dialog/content/ConfirmationDialogContent.vue'
|
import ConfirmationDialogContent from '@/components/dialog/content/ConfirmationDialogContent.vue'
|
||||||
import ErrorDialogContent from '@/components/dialog/content/ErrorDialogContent.vue'
|
import ErrorDialogContent from '@/components/dialog/content/ErrorDialogContent.vue'
|
||||||
@@ -129,32 +128,6 @@ export const useDialogService = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function showWorkflowTemplateSelectorDialog() {
|
|
||||||
const layoutDefaultProps: DialogComponentProps = {
|
|
||||||
headless: true,
|
|
||||||
modal: true,
|
|
||||||
closable: false,
|
|
||||||
pt: {
|
|
||||||
content: { class: '!px-0 overflow-hidden h-full !py-0' },
|
|
||||||
// Let internal layout manage its own max-width; prevent child from exceeding and causing scrollWidth > clientWidth
|
|
||||||
root: {
|
|
||||||
style: 'width: 90vw; height: 85vh; max-width: 1400px; display: flex;'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showLayoutDialog({
|
|
||||||
key: 'global-workflow-template-selector',
|
|
||||||
component: NewWorkflowTemplateSelectorDialog,
|
|
||||||
// Pass through sizing hint so inner layout adapts to parent rather than viewport
|
|
||||||
props: {
|
|
||||||
onClose: () =>
|
|
||||||
dialogStore.closeDialog({ key: 'global-workflow-template-selector' })
|
|
||||||
},
|
|
||||||
dialogComponentProps: layoutDefaultProps
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function showManagerDialog(
|
function showManagerDialog(
|
||||||
props: InstanceType<typeof ManagerDialogContent>['$props'] = {}
|
props: InstanceType<typeof ManagerDialogContent>['$props'] = {}
|
||||||
) {
|
) {
|
||||||
@@ -539,7 +512,7 @@ export const useDialogService = () => {
|
|||||||
showAboutDialog,
|
showAboutDialog,
|
||||||
showExecutionErrorDialog,
|
showExecutionErrorDialog,
|
||||||
showTemplateWorkflowsDialog,
|
showTemplateWorkflowsDialog,
|
||||||
showWorkflowTemplateSelectorDialog,
|
// showWorkflowTemplateSelectorDialog,
|
||||||
showManagerDialog,
|
showManagerDialog,
|
||||||
showManagerProgressDialog,
|
showManagerProgressDialog,
|
||||||
showApiNodesSignInDialog,
|
showApiNodesSignInDialog,
|
||||||
|
|||||||
Reference in New Issue
Block a user