From 09e8946cc37c881a18c02f88b8ea266c8161a6de Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Mon, 18 May 2026 14:55:02 +0800 Subject: [PATCH] fix: missing VMIM in host detail VM tab (#876) Signed-off-by: Andy Lee --- .../VirtualMachineInstance.vue | 7 +------ .../formatters/HarvesterMigrationState.vue | 7 +------ pkg/harvester/formatters/HarvesterVmState.vue | 14 -------------- pkg/harvester/list/kubevirt.io.virtualmachine.vue | 14 -------------- 4 files changed, 2 insertions(+), 40 deletions(-) diff --git a/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue index 5157fe2e..6ca88bc1 100644 --- a/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue +++ b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue @@ -27,15 +27,11 @@ export default { await allHash({ vms: this.$store.dispatch('harvester/findAll', { type: HCI.VM }), vmis: this.$store.dispatch('harvester/findAll', { type: HCI.VMI }), - allClusterNetwork: this.$store.dispatch('harvester/findAll', { type: HCI.CLUSTER_NETWORK }), + vmims: this.$store.dispatch('harvester/findAll', { type: HCI.VMIM }), }); }, computed: { - allClusterNetwork() { - return this.$store.getters['harvester/all'](HCI.CLUSTER_NETWORK); - }, - rows() { const vms = this.$store.getters['harvester/all'](HCI.VM); @@ -108,7 +104,6 @@ export default { diff --git a/pkg/harvester/formatters/HarvesterMigrationState.vue b/pkg/harvester/formatters/HarvesterMigrationState.vue index acc8f340..c3c65e7f 100644 --- a/pkg/harvester/formatters/HarvesterMigrationState.vue +++ b/pkg/harvester/formatters/HarvesterMigrationState.vue @@ -20,12 +20,7 @@ export default { computed: { vmiResource() { - const vmiList = this.$store.getters['harvester/all'](HCI.VMI) || []; - const vmi = vmiList.find( (VMI) => { - return VMI?.metadata?.ownerReferences?.[0]?.uid === this.vmResource?.metadata?.uid; - }); - - return vmi; + return this.$store.getters['harvester/byId'](HCI.VMI, this.vmResource?.id) || null; }, migrationState() { return this.vmiResource?.migrationState?.status || ''; diff --git a/pkg/harvester/formatters/HarvesterVmState.vue b/pkg/harvester/formatters/HarvesterVmState.vue index 5cd50dba..4b2bc8e6 100644 --- a/pkg/harvester/formatters/HarvesterVmState.vue +++ b/pkg/harvester/formatters/HarvesterVmState.vue @@ -14,20 +14,6 @@ export default { type: Object, required: true }, - - allNodeNetwork: { - type: Array, - default: () => { - return []; - } - }, - - allClusterNetwork: { - type: Array, - default: () => { - return []; - } - } }, data() { diff --git a/pkg/harvester/list/kubevirt.io.virtualmachine.vue b/pkg/harvester/list/kubevirt.io.virtualmachine.vue index 4b859023..bb5bf7e0 100644 --- a/pkg/harvester/list/kubevirt.io.virtualmachine.vue +++ b/pkg/harvester/list/kubevirt.io.virtualmachine.vue @@ -98,19 +98,9 @@ export default { this.hasNode = true; } - if (this.$store.getters[`${ inStore }/schemaFor`](HCI.NODE_NETWORK)) { - _hash.nodeNetworks = this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.NODE_NETWORK }); - } - - if (this.$store.getters[`${ inStore }/schemaFor`](HCI.CLUSTER_NETWORK)) { - _hash.clusterNetworks = this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.CLUSTER_NETWORK }); - } - const hash = await allHash(_hash); this.allVMs = hash.vms; - this.allNodeNetworks = hash.nodeNetworks || []; - this.allClusterNetworks = hash.clusterNetworks || []; }, data() { @@ -118,8 +108,6 @@ export default { hasNode: false, allVMs: [], allVMIs: [], - allNodeNetworks: [], - allClusterNetworks: [], restartNotificationDisplayed: false, HCI }; @@ -246,8 +234,6 @@ export default {