mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 05:19:53 +00:00
[Desktop] Add quit command (#2286)
Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Chenlei Hu <huchenlei@proton.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { t } from '@/i18n'
|
||||
import { app } from '@/scripts/app'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
||||
import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
|
||||
;(async () => {
|
||||
@@ -8,6 +9,7 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
|
||||
const electronAPI = getElectronAPI()
|
||||
const desktopAppVersion = await electronAPI.getElectronVersion()
|
||||
const workflowStore = useWorkflowStore()
|
||||
|
||||
const onChangeRestartApp = (newValue: string, oldValue: string) => {
|
||||
// Add a delay to allow changes to take effect before restarting.
|
||||
@@ -149,6 +151,25 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
function() {
|
||||
electronAPI.restartApp()
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'Comfy-Desktop.Quit',
|
||||
label: 'Quit',
|
||||
icon: 'pi pi-sign-out',
|
||||
async function() {
|
||||
// Confirm if unsaved workflows are open
|
||||
if (workflowStore.modifiedWorkflows.length > 0) {
|
||||
const confirmed = await useDialogService().confirm({
|
||||
message: t('desktopMenu.confirmQuit'),
|
||||
title: t('desktopMenu.quit'),
|
||||
type: 'default'
|
||||
})
|
||||
|
||||
if (!confirmed) return
|
||||
}
|
||||
|
||||
electronAPI.quit()
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "Desktop User Guide"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "Quit"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "Reinstall"
|
||||
},
|
||||
|
||||
@@ -361,6 +361,7 @@
|
||||
"Open DevTools": "Open DevTools",
|
||||
"Feedback": "Feedback",
|
||||
"Desktop User Guide": "Desktop User Guide",
|
||||
"Quit": "Quit",
|
||||
"Reinstall": "Reinstall",
|
||||
"Restart": "Restart",
|
||||
"Browse Templates": "Browse Templates",
|
||||
@@ -418,7 +419,9 @@
|
||||
},
|
||||
"desktopMenu": {
|
||||
"reinstall": "Reinstall",
|
||||
"confirmReinstall": "This will clear your extra_models_config.yaml file,\nand begin installation again.\n\nAre you sure?"
|
||||
"confirmReinstall": "This will clear your extra_models_config.yaml file,\nand begin installation again.\n\nAre you sure?",
|
||||
"quit": "Quit",
|
||||
"confirmQuit": "There are unsaved workflows open; any unsaved changes will be lost. Ignore this and quit?"
|
||||
},
|
||||
"settingsCategories": {
|
||||
"Comfy-Desktop": "Comfy-Desktop",
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "Guide de l'utilisateur du bureau"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "Quitter"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "Réinstaller"
|
||||
},
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
"WEBCAM": "WEBCAM"
|
||||
},
|
||||
"desktopMenu": {
|
||||
"confirmQuit": "Il y a des flux de travail non enregistrés ouverts; toutes les modifications non enregistrées seront perdues. Ignorer cela et quitter?",
|
||||
"confirmReinstall": "Cela effacera votre fichier extra_models_config.yaml,\net commencera l'installation à nouveau.\n\nÊtes-vous sûr ?",
|
||||
"quit": "Quitter",
|
||||
"reinstall": "Réinstaller"
|
||||
},
|
||||
"downloadGit": {
|
||||
@@ -319,6 +321,7 @@
|
||||
"Previous Opened Workflow": "Flux de travail ouvert précédent",
|
||||
"Queue Prompt": "Invite de file d'attente",
|
||||
"Queue Prompt (Front)": "Invite de file d'attente (Front)",
|
||||
"Quit": "Quitter",
|
||||
"Redo": "Refaire",
|
||||
"Refresh Node Definitions": "Actualiser les définitions de nœud",
|
||||
"Reinstall": "Réinstaller",
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "デスクトップユーザーガイド"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "終了"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "再インストール"
|
||||
},
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
"WEBCAM": "ウェブカメラ"
|
||||
},
|
||||
"desktopMenu": {
|
||||
"confirmQuit": "保存されていないワークフローが開いています。保存されていない変更はすべて失われます。これを無視して終了しますか?",
|
||||
"confirmReinstall": "これにより、extra_models_config.yamlファイルがクリアされ、再インストールが開始されます。本当によろしいですか?",
|
||||
"quit": "終了",
|
||||
"reinstall": "再インストール"
|
||||
},
|
||||
"downloadGit": {
|
||||
@@ -319,6 +321,7 @@
|
||||
"Previous Opened Workflow": "前に開いたワークフロー",
|
||||
"Queue Prompt": "キューのプロンプト",
|
||||
"Queue Prompt (Front)": "キューのプロンプト (前面)",
|
||||
"Quit": "終了",
|
||||
"Redo": "やり直す",
|
||||
"Refresh Node Definitions": "ノード定義を更新",
|
||||
"Reinstall": "再インストール",
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "데스크톱 사용자 가이드"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "종료"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "재설치"
|
||||
},
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
"WEBCAM": "웹캠"
|
||||
},
|
||||
"desktopMenu": {
|
||||
"confirmQuit": "저장되지 않은 워크플로우가 열려 있습니다. 저장되지 않은 변경 사항은 모두 손실됩니다. 이를 무시하고 종료하시겠습니까?",
|
||||
"confirmReinstall": "이 작업은 extra_models_config.yaml 파일을 지우고 설치를 다시 시작합니다. 정말로 진행하시겠습니까?",
|
||||
"quit": "종료",
|
||||
"reinstall": "재설치"
|
||||
},
|
||||
"downloadGit": {
|
||||
@@ -319,6 +321,7 @@
|
||||
"Previous Opened Workflow": "이전 열린 워크플로",
|
||||
"Queue Prompt": "실행 큐에 프롬프트 추가",
|
||||
"Queue Prompt (Front)": "실행 큐 맨 앞에 프롬프트 추가",
|
||||
"Quit": "종료",
|
||||
"Redo": "다시 실행",
|
||||
"Refresh Node Definitions": "노드 정의 새로 고침",
|
||||
"Reinstall": "재설치",
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "Руководство пользователя для рабочего стола"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "Выйти"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "Переустановить"
|
||||
},
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
"WEBCAM": "ВЕБ-КАМЕРА"
|
||||
},
|
||||
"desktopMenu": {
|
||||
"confirmQuit": "Открыты несохраненные рабочие процессы; все несохраненные изменения будут потеряны. Проигнорировать это и выйти?",
|
||||
"quit": "Выйти",
|
||||
"confirmReinstall": "Это очистит ваш файл extra_models_config.yaml и начнёт установку заново. Вы уверены?",
|
||||
"reinstall": "Переустановить"
|
||||
},
|
||||
@@ -319,6 +321,7 @@
|
||||
"Previous Opened Workflow": "Предыдущий открытый рабочий процесс",
|
||||
"Queue Prompt": "Запрос в очереди",
|
||||
"Queue Prompt (Front)": "Запрос в очереди (спереди)",
|
||||
"Quit": "Выйти",
|
||||
"Redo": "Повторить",
|
||||
"Refresh Node Definitions": "Обновить определения нод",
|
||||
"Reinstall": "Переустановить",
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Comfy-Desktop_OpenUserGuide": {
|
||||
"label": "桌面用户指南"
|
||||
},
|
||||
"Comfy-Desktop_Quit": {
|
||||
"label": "退出"
|
||||
},
|
||||
"Comfy-Desktop_Reinstall": {
|
||||
"label": "重新安装"
|
||||
},
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
"WEBCAM": "摄像头"
|
||||
},
|
||||
"desktopMenu": {
|
||||
"confirmQuit": "有未保存的工作流程开启;任何未保存的更改都将丢失。忽略此警告并退出?",
|
||||
"confirmReinstall": "这将清除您的 extra_models_config.yaml 文件,并重新开始安装。您确定吗?",
|
||||
"quit": "退出",
|
||||
"reinstall": "重新安装"
|
||||
},
|
||||
"downloadGit": {
|
||||
@@ -319,6 +321,7 @@
|
||||
"Previous Opened Workflow": "上一个打开的工作流",
|
||||
"Queue Prompt": "执行提示词",
|
||||
"Queue Prompt (Front)": "执行提示词 (优先执行)",
|
||||
"Quit": "退出",
|
||||
"Redo": "重做",
|
||||
"Refresh Node Definitions": "刷新节点定义",
|
||||
"Reinstall": "重新安装",
|
||||
|
||||
Reference in New Issue
Block a user