mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
move legacy option to startup arg
This commit is contained in:
@@ -15,6 +15,7 @@ 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'
|
||||||
@@ -665,8 +666,26 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
icon: 'pi pi-objects-column',
|
icon: 'pi pi-objects-column',
|
||||||
label: 'Custom Nodes (Beta)',
|
label: 'Custom Nodes (Beta)',
|
||||||
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.showManagerDialog()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dialogService.showManagerDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,14 +21,7 @@ export const CORE_MENU_COMMANDS = [
|
|||||||
],
|
],
|
||||||
[['Edit'], ['Comfy.ClearWorkflow']],
|
[['Edit'], ['Comfy.ClearWorkflow']],
|
||||||
[['Edit'], ['Comfy.OpenClipspace']],
|
[['Edit'], ['Comfy.OpenClipspace']],
|
||||||
[
|
[['Manager'], ['Comfy.Manager.CustomNodesManager.ShowCustomNodesMenu']],
|
||||||
['Manager'],
|
|
||||||
[
|
|
||||||
'Comfy.Manager.CustomNodesManager.ShowCustomNodesMenu',
|
|
||||||
'Comfy.Manager.ShowLegacyManagerMenu',
|
|
||||||
'Comfy.Manager.CustomNodesManager.ShowLegacyCustomNodesMenu'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
['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.",
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ enum ManagerRoute {
|
|||||||
GET_NODES = 'v2/customnode/getmappings',
|
GET_NODES = 'v2/customnode/getmappings',
|
||||||
GET_PACKS = 'v2/customnode/getlist',
|
GET_PACKS = 'v2/customnode/getlist',
|
||||||
IMPORT_FAIL_INFO = 'v2/customnode/import_fail_info',
|
IMPORT_FAIL_INFO = 'v2/customnode/import_fail_info',
|
||||||
REBOOT = 'v2/manager/reboot'
|
REBOOT = 'v2/manager/reboot',
|
||||||
|
IS_LEGACY_MANAGER_UI = 'v2/manager/is_legacy_manager_ui'
|
||||||
}
|
}
|
||||||
|
|
||||||
const managerApiClient = axios.create({
|
const managerApiClient = axios.create({
|
||||||
@@ -247,6 +248,15 @@ export const useComfyManagerService = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isLegacyManagerUI = async (signal?: AbortSignal) => {
|
||||||
|
const errorContext = 'Checking if user set Manager to use the legacy UI'
|
||||||
|
|
||||||
|
return executeRequest<boolean>(
|
||||||
|
() => managerApiClient.get(ManagerRoute.IS_LEGACY_MANAGER_UI, { signal }),
|
||||||
|
{ errorContext }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// State
|
// State
|
||||||
isLoading,
|
isLoading,
|
||||||
@@ -268,6 +278,7 @@ export const useComfyManagerService = () => {
|
|||||||
updateAllPacks,
|
updateAllPacks,
|
||||||
|
|
||||||
// System operations
|
// System operations
|
||||||
rebootComfyUI
|
rebootComfyUI,
|
||||||
|
isLegacyManagerUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user