[Electron] Use electronAPI to get ComfyUI core version (#1804)

This commit is contained in:
Chenlei Hu
2024-12-04 19:34:55 -08:00
committed by GitHub
parent 73f50e7e0b
commit 36c2604639
4 changed files with 15 additions and 7 deletions

8
package-lock.json generated
View File

@@ -10,7 +10,7 @@
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"dependencies": { "dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.3.19", "@comfyorg/comfyui-electron-types": "^0.3.25",
"@comfyorg/litegraph": "^0.8.42", "@comfyorg/litegraph": "^0.8.42",
"@primevue/themes": "^4.0.5", "@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0", "@vueuse/core": "^11.0.0",
@@ -1951,9 +1951,9 @@
"dev": true "dev": true
}, },
"node_modules/@comfyorg/comfyui-electron-types": { "node_modules/@comfyorg/comfyui-electron-types": {
"version": "0.3.19", "version": "0.3.25",
"resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.3.19.tgz", "resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.3.25.tgz",
"integrity": "sha512-VNr542eaLVmaeSJIvGv/Y5OiC2vYiLy+FtjwYtP+J8M5BSy88GCikX2K9NIkLPtcw9DLolVK3XWuIvFpsOK0zg==", "integrity": "sha512-DKZJ5qXJG3dn3bmdJShm/a893cPm2OzJPxI62J/9ED8OTRmKEN3CVNX3Ire7Nj4g+GRLDZHnKVo/GYSXXOtufA==",
"license": "GPL-3.0-only" "license": "GPL-3.0-only"
}, },
"node_modules/@comfyorg/litegraph": { "node_modules/@comfyorg/litegraph": {

View File

@@ -82,7 +82,7 @@
}, },
"dependencies": { "dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.3.19", "@comfyorg/comfyui-electron-types": "^0.3.25",
"@comfyorg/litegraph": "^0.8.42", "@comfyorg/litegraph": "^0.8.42",
"@primevue/themes": "^4.0.5", "@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0", "@vueuse/core": "^11.0.0",

View File

@@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
import { computed } from 'vue' import { computed } from 'vue'
import { useSystemStatsStore } from './systemStatsStore' import { useSystemStatsStore } from './systemStatsStore'
import { useExtensionStore } from './extensionStore' import { useExtensionStore } from './extensionStore'
import { electronAPI, isElectron } from '@/utils/envUtil'
export const useAboutPanelStore = defineStore('aboutPanel', () => { export const useAboutPanelStore = defineStore('aboutPanel', () => {
const frontendVersion = __COMFYUI_FRONTEND_VERSION__ const frontendVersion = __COMFYUI_FRONTEND_VERSION__
@@ -13,8 +14,14 @@ export const useAboutPanelStore = defineStore('aboutPanel', () => {
) )
const coreBadges = computed<AboutPageBadge[]>(() => [ const coreBadges = computed<AboutPageBadge[]>(() => [
// In electron, the ComfyUI is packaged without the git repo,
// so the python server's API doesn't have the version info.
{ {
label: `ComfyUI ${coreVersion.value}`, label: `ComfyUI ${
isElectron()
? 'v' + electronAPI().getComfyUIVersion()
: coreVersion.value
}`,
url: 'https://github.com/comfyanonymous/ComfyUI', url: 'https://github.com/comfyanonymous/ComfyUI',
icon: 'pi pi-github' icon: 'pi pi-github'
}, },

View File

@@ -50,7 +50,8 @@ const mockElectronAPI: Plugin = {
getAllDownloads: () => Promise.resolve([]), getAllDownloads: () => Promise.resolve([]),
onDownloadProgress: () => {} onDownloadProgress: () => {}
}, },
getElectronVersion: () => Promise.resolve('1.0.0') getElectronVersion: () => Promise.resolve('1.0.0'),
getComfyUIVersion: () => '9.9.9'
};` };`
} }
] ]