fix: missing VMIM in host detail VM tab (#876)

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2026-05-18 14:55:02 +08:00 committed by GitHub
parent e70c684382
commit 09e8946cc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2 additions and 40 deletions

View File

@ -27,15 +27,11 @@ export default {
await allHash({ await allHash({
vms: this.$store.dispatch('harvester/findAll', { type: HCI.VM }), vms: this.$store.dispatch('harvester/findAll', { type: HCI.VM }),
vmis: this.$store.dispatch('harvester/findAll', { type: HCI.VMI }), 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: { computed: {
allClusterNetwork() {
return this.$store.getters['harvester/all'](HCI.CLUSTER_NETWORK);
},
rows() { rows() {
const vms = this.$store.getters['harvester/all'](HCI.VM); const vms = this.$store.getters['harvester/all'](HCI.VM);
@ -108,7 +104,6 @@ export default {
<HarvesterVmState <HarvesterVmState
class="vmstate" class="vmstate"
:row="scope.row" :row="scope.row"
:all-cluster-network="allClusterNetwork"
/> />
</div> </div>
</template> </template>

View File

@ -20,12 +20,7 @@ export default {
computed: { computed: {
vmiResource() { vmiResource() {
const vmiList = this.$store.getters['harvester/all'](HCI.VMI) || []; return this.$store.getters['harvester/byId'](HCI.VMI, this.vmResource?.id) || null;
const vmi = vmiList.find( (VMI) => {
return VMI?.metadata?.ownerReferences?.[0]?.uid === this.vmResource?.metadata?.uid;
});
return vmi;
}, },
migrationState() { migrationState() {
return this.vmiResource?.migrationState?.status || ''; return this.vmiResource?.migrationState?.status || '';

View File

@ -14,20 +14,6 @@ export default {
type: Object, type: Object,
required: true required: true
}, },
allNodeNetwork: {
type: Array,
default: () => {
return [];
}
},
allClusterNetwork: {
type: Array,
default: () => {
return [];
}
}
}, },
data() { data() {

View File

@ -98,19 +98,9 @@ export default {
this.hasNode = true; 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); const hash = await allHash(_hash);
this.allVMs = hash.vms; this.allVMs = hash.vms;
this.allNodeNetworks = hash.nodeNetworks || [];
this.allClusterNetworks = hash.clusterNetworks || [];
}, },
data() { data() {
@ -118,8 +108,6 @@ export default {
hasNode: false, hasNode: false,
allVMs: [], allVMs: [],
allVMIs: [], allVMIs: [],
allNodeNetworks: [],
allClusterNetworks: [],
restartNotificationDisplayed: false, restartNotificationDisplayed: false,
HCI HCI
}; };
@ -246,8 +234,6 @@ export default {
<HarvesterVmState <HarvesterVmState
class="vmstate" class="vmstate"
:row="scope.row" :row="scope.row"
:all-node-network="allNodeNetworks"
:all-cluster-network="allClusterNetworks"
/> />
</div> </div>
</template> </template>