diff --git a/src/components/breadcrumb/SubgraphBreadcrumb.vue b/src/components/breadcrumb/SubgraphBreadcrumb.vue index af6324aa9..e710f6c82 100644 --- a/src/components/breadcrumb/SubgraphBreadcrumb.vue +++ b/src/components/breadcrumb/SubgraphBreadcrumb.vue @@ -40,6 +40,7 @@ import SubgraphBreadcrumbItem from '@/components/breadcrumb/SubgraphBreadcrumbIt import { useOverflowObserver } from '@/composables/element/useOverflowObserver' import { useCanvasStore } from '@/stores/graphStore' import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore' +import { useSubgraphStore } from '@/stores/subgraphStore' import { useWorkflowStore } from '@/stores/workflowStore' import { forEachSubgraphNode } from '@/utils/graphTraversalUtil' @@ -52,6 +53,9 @@ const workflowStore = useWorkflowStore() const navigationStore = useSubgraphNavigationStore() const breadcrumbRef = ref>() const workflowName = computed(() => workflowStore.activeWorkflow?.filename) +const isBlueprint = computed(() => + useSubgraphStore().isSubgraphBlueprint(workflowStore.activeWorkflow) +) const collapseTabs = ref(false) const overflowingTabs = ref(false) @@ -89,6 +93,7 @@ const home = computed(() => ({ label: workflowName.value, icon: 'pi pi-home', key: 'root', + isBlueprint: isBlueprint.value, command: () => { const canvas = useCanvasStore().getCanvas() if (!canvas.graph) throw new TypeError('Canvas has no graph') diff --git a/src/components/breadcrumb/SubgraphBreadcrumbItem.vue b/src/components/breadcrumb/SubgraphBreadcrumbItem.vue index b980c0e2d..eb688dff6 100644 --- a/src/components/breadcrumb/SubgraphBreadcrumbItem.vue +++ b/src/components/breadcrumb/SubgraphBreadcrumbItem.vue @@ -16,6 +16,7 @@ @click="handleClick" > {{ item.label }} + (() => { command: async () => { await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) }, - visible: isRoot + visible: isRoot && !props.item.isBlueprint }, { separator: true, @@ -153,12 +155,26 @@ const menuItems = computed(() => { await useCommandStore().execute('Comfy.ClearWorkflow') } }, + { + separator: true, + visible: props.item.key === 'root' && props.item.isBlueprint + }, + { + label: t('subgraphStore.publish'), + icon: 'pi pi-copy', + command: async () => { + await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) + }, + visible: props.item.key === 'root' && props.item.isBlueprint + }, { separator: true, visible: isRoot }, { - label: t('breadcrumbsMenu.deleteWorkflow'), + label: props.item.isBlueprint + ? t('breadcrumbsMenu.deleteBlueprint') + : t('breadcrumbsMenu.deleteWorkflow'), icon: 'pi pi-times', command: async () => { await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) diff --git a/src/components/dialog/content/ConfirmationDialogContent.vue b/src/components/dialog/content/ConfirmationDialogContent.vue index e589b468e..842017783 100644 --- a/src/components/dialog/content/ConfirmationDialogContent.vue +++ b/src/components/dialog/content/ConfirmationDialogContent.vue @@ -16,6 +16,21 @@ {{ hint }}
+
+ + +
+ + + + diff --git a/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue b/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue index 1f1d782f3..2dc099c41 100644 --- a/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue +++ b/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue @@ -1,6 +1,6 @@