diff --git a/src/components/dialog/GlobalDialog.vue b/src/components/dialog/GlobalDialog.vue index 8df8598a2..3d1da6baf 100644 --- a/src/components/dialog/GlobalDialog.vue +++ b/src/components/dialog/GlobalDialog.vue @@ -16,7 +16,7 @@ :is="item.headerComponent" :id="item.key" /> -

{{ item.title || ' ' }}

+

{{ item.title || ' ' }}

+ + + + + + + + + diff --git a/src/components/troubleshooting/TroubleshootingContent.vue b/src/components/troubleshooting/TroubleshootingContent.vue new file mode 100644 index 000000000..dd0a05c4c --- /dev/null +++ b/src/components/troubleshooting/TroubleshootingContent.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/locales/en.ts b/src/locales/en.ts index 017ea3de4..ab2d69a8f 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -240,5 +240,17 @@ export default { resume: 'Resume Download', cancel: 'Cancel Download', cancelled: 'Cancelled' + }, + troubleshooting: { + title: 'Troubleshooting', + tasks: { + restoreCustomNodes: 'Restore Custom Nodes' + }, + restoreCustomNodes: { + loading: 'Parsing log files...', + installing: 'Installing', + installed: 'Installed', + failed: 'Failed' + } } } diff --git a/src/services/dialogService.ts b/src/services/dialogService.ts index 1021f30e9..21dfb649d 100644 --- a/src/services/dialogService.ts +++ b/src/services/dialogService.ts @@ -12,6 +12,7 @@ import TemplateWorkflowsContent from '@/components/templates/TemplateWorkflowsCo import PromptDialogContent from '@/components/dialog/content/PromptDialogContent.vue' import { i18n } from '@/i18n' import type { MissingNodeType } from '@/types/comfy' +import TroubleshootingContent from '@/components/troubleshooting/TroubleshootingContent.vue' export function showLoadWorkflowWarning(props: { missingNodeTypes: MissingNodeType[] @@ -89,3 +90,10 @@ export async function showPromptDialog({ }) }) } + +export function showTroubleshootingDialog() { + useDialogStore().showDialog({ + title: i18n.global.t('troubleshooting.title'), + component: TroubleshootingContent + }) +} diff --git a/src/stores/commandStore.ts b/src/stores/commandStore.ts index 7050707c1..da3b20876 100644 --- a/src/stores/commandStore.ts +++ b/src/stores/commandStore.ts @@ -6,7 +6,8 @@ import { useSettingStore } from '@/stores/settingStore' import { useToastStore } from '@/stores/toastStore' import { showSettingsDialog, - showTemplateWorkflowsDialog + showTemplateWorkflowsDialog, + showTroubleshootingDialog } from '@/services/dialogService' import { useQueueSettingsStore, useQueueStore } from './queueStore' import { LiteGraph } from '@comfyorg/litegraph' @@ -20,6 +21,7 @@ import { useBottomPanelStore } from './workspace/bottomPanelStore' import { LGraphNode } from '@comfyorg/litegraph' import { useWorkspaceStore } from './workspaceStore' import { workflowService } from '@/services/workflowService' +import { i18n } from '@/i18n' export interface ComfyCommand { id: string @@ -511,6 +513,15 @@ export const useCommandStore = defineStore('command', () => { } } } + }, + { + id: 'Comfy.Troubleshooting.Open', + icon: 'pi pi-wrench', + label: i18n.global.t('troubleshooting.title'), + versionAdded: '1.5.3', + function: () => { + showTroubleshootingDialog() + } } ] diff --git a/src/stores/menuItemStore.ts b/src/stores/menuItemStore.ts index f29422338..dbbfb1186 100644 --- a/src/stores/menuItemStore.ts +++ b/src/stores/menuItemStore.ts @@ -3,6 +3,7 @@ import type { MenuItem } from 'primevue/menuitem' import { ref } from 'vue' import { useCommandStore } from './commandStore' import { ComfyExtension } from '@/types/comfy' +import { isElectron } from '@/utils/envUtil' export const useMenuItemStore = defineStore('menuItem', () => { const commandStore = useCommandStore() @@ -119,6 +120,8 @@ export const useMenuItemStore = defineStore('menuItem', () => { } ] ) + // TODO: Remove temporary electron guard after this is generally available + if (isElectron()) registerCommands(['Help'], ['Comfy.Troubleshooting.Open']) return { menuItems,