ui: fix error jobid not found & console error when using filter (#5323)

Fixes #5322
This commit is contained in:
Hoang Nguyen 2021-08-17 14:24:07 +07:00 committed by GitHub
parent 873dc5492b
commit 72182b6bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@
v-else />
</div>
<div slot="memused" slot-scope="record">
<span v-if="record.memoryused | byteToGigabyte">
<span v-if="record.memoryused">
{{ record.memoryused | byteToGigabyte }} GB
</span>
</div>
@ -197,7 +197,9 @@ export default {
var migrateParams = this.selectedHost.id === -1 ? { autoselect: true, virtualmachineid: this.resource.id }
: { hostid: this.selectedHost.id, virtualmachineid: this.resource.id }
api(migrateApi, migrateParams).then(response => {
const jobid = this.selectedHost.requiresStorageMotion ? response.migratevirtualmachinewithvolumeresponse.jobid : response.migratevirtualmachineresponse.jobid
const jobid = isUserVm
? this.selectedHost.requiresStorageMotion ? response.migratevirtualmachinewithvolumeresponse.jobid : response.migratevirtualmachineresponse.jobid
: response.migratesystemvmresponse.jobid
this.$pollJob({
jobId: jobid,
title: `${this.$t('label.migrating')} ${this.resource.name}`,