fix: update version

This commit is contained in:
yiqun12
2025-06-08 09:14:38 -07:00
parent 048af23439
commit a8bbe8f301
5 changed files with 4 additions and 101 deletions

View File

@@ -313,6 +313,7 @@ export const zSystemStats = z.object({
python_version: z.string(),
embedded_python: z.boolean(),
comfyui_version: z.string(),
workflows_templates_version: z.string(),
pytorch_version: z.string(),
argv: z.array(z.string()),
ram_total: z.number(),

View File

@@ -733,14 +733,6 @@ export class ComfyApi extends EventTarget {
return await res.json()
}
async getTemplatesVersion(): Promise<{ version: string }> {
const res = await this.fetchApi('/templates_version')
if (!res.ok) {
throw new Error(`Failed to fetch /templates_version: ${res.statusText}`)
}
return res.json()
}
/**
* Sends a POST request to the API
* @param {*} type The endpoint to post to

View File

@@ -1,30 +1,25 @@
import { defineStore } from 'pinia'
import { computed, onMounted } from 'vue'
import { computed } from 'vue'
import { AboutPageBadge } from '@/types/comfy'
import { electronAPI, isElectron } from '@/utils/envUtil'
import { useExtensionStore } from './extensionStore'
import { useSystemStatsStore } from './systemStatsStore'
import { useTemplateVersionStore } from './templateVersionStore'
export const useAboutPanelStore = defineStore('aboutPanel', () => {
const frontendVersion = __COMFYUI_FRONTEND_VERSION__
const extensionStore = useExtensionStore()
const systemStatsStore = useSystemStatsStore()
const templateVersionStore = useTemplateVersionStore()
const coreVersion = computed(
() => systemStatsStore?.systemStats?.system?.comfyui_version ?? ''
)
const workflowsTemplatesVersion = computed(
() => templateVersionStore?.workflowsTemplatesVersion
() =>
systemStatsStore?.systemStats?.system?.workflows_templates_version ?? ''
)
onMounted(async () => {
await templateVersionStore.fetchTemplateVersion()
})
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.

View File

@@ -1,34 +0,0 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { api } from '@/scripts/api'
export const useTemplateVersionStore = defineStore('templateVersion', () => {
const workflowsTemplatesVersion = ref('')
const isLoading = ref(false)
const error = ref<string | null>(null)
async function fetchTemplateVersion() {
isLoading.value = true
error.value = null
try {
const response = await api.getTemplatesVersion()
workflowsTemplatesVersion.value = response.version
} catch (err) {
error.value =
err instanceof Error ? err.message : 'Failed to fetch template version'
console.error('Error fetching template version:', err)
workflowsTemplatesVersion.value = ''
} finally {
isLoading.value = false
}
}
return {
workflowsTemplatesVersion,
isLoading,
error,
fetchTemplateVersion
}
})