mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
move legacy option to startup arg
This commit is contained in:
@@ -15,10 +15,11 @@ import { t } from '@/i18n'
|
|||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { addFluxKontextGroupNode } from '@/scripts/fluxKontextEditNode'
|
import { addFluxKontextGroupNode } from '@/scripts/fluxKontextEditNode'
|
||||||
|
import { useComfyManagerService } from '@/services/comfyManagerService'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
import { useWorkflowService } from '@/services/workflowService'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { type ComfyCommand, useCommandStore } from '@/stores/commandStore'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useCanvasStore, useTitleEditorStore } from '@/stores/graphStore'
|
import { useCanvasStore, useTitleEditorStore } from '@/stores/graphStore'
|
||||||
import { useQueueSettingsStore, useQueueStore } from '@/stores/queueStore'
|
import { useQueueSettingsStore, useQueueStore } from '@/stores/queueStore'
|
||||||
@@ -664,8 +665,26 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
icon: 'pi pi-puzzle',
|
icon: 'pi pi-puzzle',
|
||||||
label: 'Toggle the Custom Nodes Manager',
|
label: 'Toggle the Custom Nodes Manager',
|
||||||
versionAdded: '1.12.10',
|
versionAdded: '1.12.10',
|
||||||
function: () => {
|
function: async () => {
|
||||||
dialogService.toggleManagerDialog()
|
const isLegacyManagerUI =
|
||||||
|
await useComfyManagerService().isLegacyManagerUI()
|
||||||
|
if (isLegacyManagerUI) {
|
||||||
|
try {
|
||||||
|
await useCommandStore().execute(
|
||||||
|
'Comfy.Manager.Menu.ToggleVisibility' // This command is registered by legacy manager FE extension
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
useToastStore().add({
|
||||||
|
severity: 'error',
|
||||||
|
summary: t('g.error'),
|
||||||
|
detail: t('manager.legacyMenuNotAvailable'),
|
||||||
|
life: 3000
|
||||||
|
})
|
||||||
|
dialogService.toggleManagerDialog()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dialogService.toggleManagerDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,19 +11,17 @@ export const CORE_MENU_COMMANDS = [
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
[['Edit'], ['Comfy.Undo', 'Comfy.Redo']],
|
[['Edit'], ['Comfy.Undo', 'Comfy.Redo']],
|
||||||
[['Edit'], ['Comfy.RefreshNodeDefinitions']],
|
|
||||||
[['Edit'], ['Comfy.ClearWorkflow']],
|
|
||||||
[['Edit'], ['Comfy.OpenClipspace']],
|
|
||||||
[
|
[
|
||||||
['Manager'],
|
['Edit'],
|
||||||
[
|
[
|
||||||
'Comfy.Manager.ShowLegacyManagerMenu',
|
'Comfy.RefreshNodeDefinitions',
|
||||||
'Comfy.Manager.CustomNodesManager.ShowLegacyCustomNodesMenu',
|
|
||||||
'Comfy.Manager.CustomNodesManager.ShowCustomNodesMenu',
|
|
||||||
'Comfy.Memory.UnloadModels',
|
'Comfy.Memory.UnloadModels',
|
||||||
'Comfy.Memory.UnloadModelsAndExecutionCache'
|
'Comfy.Memory.UnloadModelsAndExecutionCache'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
[['Edit'], ['Comfy.ClearWorkflow']],
|
||||||
|
[['Edit'], ['Comfy.OpenClipspace']],
|
||||||
|
[['Manager'], ['Comfy.Manager.CustomNodesManager.ShowCustomNodesMenu']],
|
||||||
[
|
[
|
||||||
['Help'],
|
['Help'],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
},
|
},
|
||||||
"manager": {
|
"manager": {
|
||||||
"title": "Custom Nodes Manager",
|
"title": "Custom Nodes Manager",
|
||||||
"legacyMenuNotAvailable": "Legacy manager menu is not available in this version of ComfyUI. Please use the new manager menu instead.",
|
"legacyMenuNotAvailable": "Legacy manager menu is not available, defaulting to the new manager menu.",
|
||||||
"failed": "Failed ({count})",
|
"failed": "Failed ({count})",
|
||||||
"noNodesFound": "No nodes found",
|
"noNodesFound": "No nodes found",
|
||||||
"noNodesFoundDescription": "The pack's nodes either could not be parsed, or the pack is a frontend extension only and doesn't have any nodes.",
|
"noNodesFoundDescription": "The pack's nodes either could not be parsed, or the pack is a frontend extension only and doesn't have any nodes.",
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ export const useComfyManagerService = () => {
|
|||||||
const isLegacyManagerUI = async (signal?: AbortSignal) => {
|
const isLegacyManagerUI = async (signal?: AbortSignal) => {
|
||||||
const errorContext = 'Checking if user set Manager to use the legacy UI'
|
const errorContext = 'Checking if user set Manager to use the legacy UI'
|
||||||
|
|
||||||
return executeRequest<{ is_legacy_manager_ui: boolean }>(
|
return executeRequest<boolean>(
|
||||||
() => managerApiClient.get(ManagerRoute.IS_LEGACY_MANAGER_UI, { signal }),
|
() => managerApiClient.get(ManagerRoute.IS_LEGACY_MANAGER_UI, { signal }),
|
||||||
{ errorContext }
|
{ errorContext }
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user