mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 09:14:25 +00:00
## Summary Only remaining use is in `buttonTypes.ts` which @viva-jinyi is going to be working on to consolidate our different buttons soon. ## Changes - **What**: Replace light/dark colors with theme aware design system tokens. ## Review Focus Double check the chosen colors for the components ## Screenshots | Before | After | | ------ | ----- | | <img width="607" height="432" alt="image" src="https://github.com/user-attachments/assets/6c0ee6d6-819f-40b1-b775-f8b25dd18104" /> | <img width="646" height="488" alt="image" src="https://github.com/user-attachments/assets/9c8532de-8ac6-4b48-9021-3fd0b3e0bc63" /> | ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6705-Style-WIP-Design-System-use-across-more-components-2ab6d73d365081619115fc5f87a46341) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
84 lines
2.2 KiB
Vue
84 lines
2.2 KiB
Vue
<template>
|
|
<Message
|
|
v-if="hasMissingCoreNodes"
|
|
severity="info"
|
|
icon="pi pi-info-circle"
|
|
class="mx-2 my-2"
|
|
:pt="{
|
|
root: { class: 'flex-col' },
|
|
text: { class: 'flex-1' }
|
|
}"
|
|
>
|
|
<div class="flex flex-col gap-2">
|
|
<div>
|
|
{{
|
|
currentComfyUIVersion
|
|
? $t('loadWorkflowWarning.outdatedVersion', {
|
|
version: currentComfyUIVersion
|
|
})
|
|
: $t('loadWorkflowWarning.outdatedVersionGeneric')
|
|
}}
|
|
</div>
|
|
<div
|
|
v-for="[version, nodes] in sortedMissingCoreNodes"
|
|
:key="version"
|
|
class="ml-4"
|
|
>
|
|
<div class="text-sm font-medium text-surface-600">
|
|
{{
|
|
$t('loadWorkflowWarning.coreNodesFromVersion', {
|
|
version: version || 'unknown'
|
|
})
|
|
}}
|
|
</div>
|
|
<div class="ml-4 text-sm text-surface-500">
|
|
{{ getUniqueNodeNames(nodes).join(', ') }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Message>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Message from 'primevue/message'
|
|
import { compare } from 'semver'
|
|
import { computed } from 'vue'
|
|
|
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
|
import { useSystemStatsStore } from '@/stores/systemStatsStore'
|
|
|
|
const { missingCoreNodes } = defineProps<{
|
|
missingCoreNodes: Record<string, LGraphNode[]>
|
|
}>()
|
|
|
|
const systemStatsStore = useSystemStatsStore()
|
|
|
|
const hasMissingCoreNodes = computed(() => {
|
|
return Object.keys(missingCoreNodes).length > 0
|
|
})
|
|
|
|
// Use computed for reactive version tracking
|
|
const currentComfyUIVersion = computed<string | null>(() => {
|
|
if (!hasMissingCoreNodes.value) return null
|
|
return systemStatsStore.systemStats?.system?.comfyui_version ?? null
|
|
})
|
|
|
|
const sortedMissingCoreNodes = computed(() => {
|
|
return Object.entries(missingCoreNodes).sort(([a], [b]) => {
|
|
// Sort by version in descending order (newest first)
|
|
return compare(b, a) // Reversed for descending order
|
|
})
|
|
})
|
|
|
|
const getUniqueNodeNames = (nodes: LGraphNode[]): string[] => {
|
|
return nodes
|
|
.reduce<string[]>((acc, node) => {
|
|
if (node.type && !acc.includes(node.type)) {
|
|
acc.push(node.type)
|
|
}
|
|
return acc
|
|
}, [])
|
|
.sort()
|
|
}
|
|
</script>
|