mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-06-13 13:32:20 +00:00
fix: snapshot/backup/volume attach VM name (#918)
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
d2db23d69a
commit
b18aebbbd4
@ -31,6 +31,10 @@ export default {
|
|||||||
to() {
|
to() {
|
||||||
return this.vm?.detailLocation;
|
return this.vm?.detailLocation;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
attachVMName() {
|
||||||
|
return this.vm?.nameDisplay || this.vm?.metadata?.name || this.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -40,10 +44,10 @@ export default {
|
|||||||
v-if="to"
|
v-if="to"
|
||||||
:to="to"
|
:to="to"
|
||||||
>
|
>
|
||||||
{{ value }}
|
{{ attachVMName }}
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<span v-else>
|
<span v-else>
|
||||||
{{ value }}
|
{{ attachVMName }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -106,8 +106,8 @@ export default {
|
|||||||
name: 'AttachedVM',
|
name: 'AttachedVM',
|
||||||
labelKey: 'tableHeaders.attachedVM',
|
labelKey: 'tableHeaders.attachedVM',
|
||||||
type: 'attached',
|
type: 'attached',
|
||||||
value: 'spec.claimRef',
|
value: 'attachVMName',
|
||||||
sort: 'name',
|
sort: 'attachVMName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'VolumeSnapshotCounts',
|
name: 'VolumeSnapshotCounts',
|
||||||
@ -134,8 +134,8 @@ export default {
|
|||||||
return row?.attachVM?.detailLocation;
|
return row?.attachVM?.detailLocation;
|
||||||
},
|
},
|
||||||
|
|
||||||
getVMName(row) {
|
getAttachedVMName(row) {
|
||||||
return row.attachVM?.metadata?.name || '';
|
return row.attachVMName || '';
|
||||||
},
|
},
|
||||||
|
|
||||||
isInternalStorageClass(storageClassName) {
|
isInternalStorageClass(storageClassName) {
|
||||||
@ -173,10 +173,10 @@ export default {
|
|||||||
<template #cell:AttachedVM="{row}">
|
<template #cell:AttachedVM="{row}">
|
||||||
<div>
|
<div>
|
||||||
<router-link
|
<router-link
|
||||||
v-if="getVMName(row)"
|
v-if="getAttachedVMName(row)"
|
||||||
:to="goTo(row)"
|
:to="goTo(row)"
|
||||||
>
|
>
|
||||||
{{ getVMName(row) }}
|
{{ getAttachedVMName(row) }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -235,6 +235,10 @@ export default class HciPv extends HarvesterResource {
|
|||||||
return allVMs.find(findAttachVM);
|
return allVMs.find(findAttachVM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get attachVMName() {
|
||||||
|
return this.attachVM?.nameDisplay || this.attachVM?.metadata?.name || '';
|
||||||
|
}
|
||||||
|
|
||||||
get isAvailable() {
|
get isAvailable() {
|
||||||
const unAvailable = ['Resizing', 'Not Ready'];
|
const unAvailable = ['Resizing', 'Not Ready'];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user