fix: snapshot/backup/volume attach VM name (#918)

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2026-06-08 16:49:09 +08:00 committed by GitHub
parent d2db23d69a
commit b18aebbbd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View File

@ -31,6 +31,10 @@ export default {
to() {
return this.vm?.detailLocation;
},
attachVMName() {
return this.vm?.nameDisplay || this.vm?.metadata?.name || this.value;
}
}
};
</script>
@ -40,10 +44,10 @@ export default {
v-if="to"
:to="to"
>
{{ value }}
{{ attachVMName }}
</router-link>
<span v-else>
{{ value }}
{{ attachVMName }}
</span>
</template>

View File

@ -106,8 +106,8 @@ export default {
name: 'AttachedVM',
labelKey: 'tableHeaders.attachedVM',
type: 'attached',
value: 'spec.claimRef',
sort: 'name',
value: 'attachVMName',
sort: 'attachVMName',
},
{
name: 'VolumeSnapshotCounts',
@ -134,8 +134,8 @@ export default {
return row?.attachVM?.detailLocation;
},
getVMName(row) {
return row.attachVM?.metadata?.name || '';
getAttachedVMName(row) {
return row.attachVMName || '';
},
isInternalStorageClass(storageClassName) {
@ -173,10 +173,10 @@ export default {
<template #cell:AttachedVM="{row}">
<div>
<router-link
v-if="getVMName(row)"
v-if="getAttachedVMName(row)"
:to="goTo(row)"
>
{{ getVMName(row) }}
{{ getAttachedVMName(row) }}
</router-link>
</div>
</template>

View File

@ -235,6 +235,10 @@ export default class HciPv extends HarvesterResource {
return allVMs.find(findAttachVM);
}
get attachVMName() {
return this.attachVM?.nameDisplay || this.attachVM?.metadata?.name || '';
}
get isAvailable() {
const unAvailable = ['Resizing', 'Not Ready'];