[Manager] Add tab for outdated node packs (has update available) (#3255)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Christian Byrne
2025-04-07 06:49:40 +08:00
committed by GitHub
parent fa75614dc3
commit 549a42716f
10 changed files with 79 additions and 19 deletions

View File

@@ -0,0 +1,35 @@
import { computed } from 'vue'
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
import type { components } from '@/types/comfyRegistryTypes'
import { compareVersions, isSemVer } from '@/utils/formatUtil'
export const usePackUpdateStatus = (
nodePack: components['schemas']['Node']
) => {
const { isPackInstalled, getInstalledPackVersion } = useComfyManagerStore()
const isInstalled = computed(() => isPackInstalled(nodePack?.id))
const installedVersion = computed(() =>
getInstalledPackVersion(nodePack.id ?? '')
)
const latestVersion = computed(() => nodePack.latest_version?.version)
const isNightlyPack = computed(
() => !!installedVersion.value && !isSemVer(installedVersion.value)
)
const isUpdateAvailable = computed(() => {
if (!isInstalled.value || isNightlyPack.value || !latestVersion.value) {
return false
}
return compareVersions(latestVersion.value, installedVersion.value) > 0
})
return {
isUpdateAvailable,
isNightlyPack,
installedVersion,
latestVersion
}
}