mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 21:20:12 +00:00
[System Pop Up] Add help center with release notifications and "What's New" popup (#4256)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { ref } from 'vue'
|
||||
|
||||
import type { SystemStats } from '@/schemas/apiSchema'
|
||||
import { api } from '@/scripts/api'
|
||||
import { isElectron } from '@/utils/envUtil'
|
||||
|
||||
export const useSystemStatsStore = defineStore('systemStats', () => {
|
||||
const systemStats = ref<SystemStats | null>(null)
|
||||
@@ -26,10 +27,42 @@ export const useSystemStatsStore = defineStore('systemStats', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function getFormFactor(): string {
|
||||
if (!systemStats.value?.system?.os) {
|
||||
return 'other'
|
||||
}
|
||||
|
||||
const os = systemStats.value.system.os.toLowerCase()
|
||||
const isDesktop = isElectron()
|
||||
|
||||
if (isDesktop) {
|
||||
if (os.includes('windows')) {
|
||||
return 'desktop-windows'
|
||||
}
|
||||
if (os.includes('darwin') || os.includes('mac')) {
|
||||
return 'desktop-mac'
|
||||
}
|
||||
} else {
|
||||
// Git/source installation
|
||||
if (os.includes('windows')) {
|
||||
return 'git-windows'
|
||||
}
|
||||
if (os.includes('darwin') || os.includes('mac')) {
|
||||
return 'git-mac'
|
||||
}
|
||||
if (os.includes('linux')) {
|
||||
return 'git-linux'
|
||||
}
|
||||
}
|
||||
|
||||
return 'other'
|
||||
}
|
||||
|
||||
return {
|
||||
systemStats,
|
||||
isLoading,
|
||||
error,
|
||||
fetchSystemStats
|
||||
fetchSystemStats,
|
||||
getFormFactor
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user