From 75bacaf8c942fd482f466cafa796a6dcb5256056 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Mon, 28 Sep 2020 17:49:17 +0700 Subject: [PATCH] compute: Back to list VM when deleting VM with the Expunge option. (#755) * compute: back to list VM when deleting VM with the Expunge option. * fixes: go back if is a detail view * fix go back only vm detail view Signed-off-by: Rohit Yadav --- ui/src/views/compute/DestroyVM.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/views/compute/DestroyVM.vue b/ui/src/views/compute/DestroyVM.vue index 518204b3cdb..a20f6141a03 100644 --- a/ui/src/views/compute/DestroyVM.vue +++ b/ui/src/views/compute/DestroyVM.vue @@ -134,9 +134,15 @@ export default { jobId, loadingMessage: `${this.$t('message.deleting.vm')} ${this.resource.name}`, catchMessage: this.$t('error.fetching.async.job.result'), - successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}` + successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}`, + successMethod: () => { + if (this.$route.path.includes('/vm/') && values.expunge) { + this.$router.go(-1) + } else { + this.parentFetchData() + } + } }) - this.parentFetchData() this.closeAction() }).catch(error => { this.$notifyError(error)