mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
Add node pack version selector dropdown (#2973)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -21,7 +21,11 @@
|
||||
/>
|
||||
</MetadataRow>
|
||||
<MetadataRow :label="t('manager.version')">
|
||||
<PackVersionBadge :version="nodePack.latest_version?.version" />
|
||||
<PackVersionBadge
|
||||
:node-pack="nodePack"
|
||||
:version="selectedVersion"
|
||||
@update:version="updateSelectedVersion"
|
||||
/>
|
||||
</MetadataRow>
|
||||
</div>
|
||||
<div class="mb-6 overflow-hidden">
|
||||
@@ -32,7 +36,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import PackStatusMessage from '@/components/dialog/content/manager/PackStatusMessage.vue'
|
||||
@@ -40,6 +44,7 @@ import PackVersionBadge from '@/components/dialog/content/manager/PackVersionBad
|
||||
import InfoTabs from '@/components/dialog/content/manager/infoPanel/InfoTabs.vue'
|
||||
import MetadataRow from '@/components/dialog/content/manager/infoPanel/MetadataRow.vue'
|
||||
import PackCardHeader from '@/components/dialog/content/manager/packCard/PackCardHeader.vue'
|
||||
import { SelectedVersion } from '@/types/comfyManagerTypes'
|
||||
import { components } from '@/types/comfyRegistryTypes'
|
||||
import { formatNumber } from '@/utils/formatUtil'
|
||||
|
||||
@@ -49,16 +54,29 @@ interface InfoItem {
|
||||
value: string | number | undefined
|
||||
}
|
||||
|
||||
const { t, d } = useI18n()
|
||||
|
||||
const { nodePack } = defineProps<{
|
||||
nodePack: components['schemas']['Node']
|
||||
}>()
|
||||
|
||||
const { t, d } = useI18n()
|
||||
|
||||
const packCardHeaderRef = ref(null)
|
||||
|
||||
const selectedVersion = ref<string>(
|
||||
nodePack.latest_version?.version || SelectedVersion.NIGHTLY
|
||||
)
|
||||
const updateSelectedVersion = (version: string) => {
|
||||
selectedVersion.value = version
|
||||
if (packCardHeaderRef.value) {
|
||||
packCardHeaderRef.value.updateVersion?.(version)
|
||||
}
|
||||
}
|
||||
|
||||
const infoItems = computed<InfoItem[]>(() => [
|
||||
{
|
||||
key: 'publisher',
|
||||
label: `${t('manager.createdBy')}`,
|
||||
label: t('manager.createdBy'),
|
||||
// TODO: handle all Comfy Registry publisher types dynamically (e.g., organizations, multiple authors)
|
||||
value: nodePack.publisher?.name
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user