From 9ee6a57311562c89ab90d524bb63d4769c655465 Mon Sep 17 00:00:00 2001 From: davidjumani Date: Thu, 1 Jul 2021 15:58:39 +0530 Subject: [PATCH] ui: deployvm - Add option to stay on page (#4843) * ui: deployvm - Add option to stay on page * Moving option to a dropdown --- ui/public/locales/en.json | 1 + ui/src/views/compute/DeployVM.vue | 31 ++++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index cd07ee2f25b..bab3f4daac3 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1218,6 +1218,7 @@ "label.latest.events": "Latest events", "label.launch": "Launch", "label.launch.vm": "Launch Virtual Machine", +"label.launch.vm.and.stay": "Launch VM & Stay On This Page", "label.launch.zone": "Launch Zone", "label.lb.algorithm.leastconn": "Least connections", "label.lb.algorithm.roundrobin": "Round-robin", diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index 16abfa80aa3..a7a9ebbdbfd 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -600,14 +600,27 @@ @@ -1362,6 +1375,15 @@ export default { getText (option) { return _.get(option, 'displaytext', _.get(option, 'name')) }, + handleSubmitAndStay (e) { + this.form.setFieldsValue({ + stayonpage: true + }) + this.handleSubmit(e.domEvent) + this.form.setFieldsValue({ + stayonpage: false + }) + }, handleSubmit (e) { console.log('wizard submit') e.preventDefault() @@ -1585,9 +1607,12 @@ export default { new Promise(resolve => setTimeout(resolve, 3000)).then(() => { eventBus.$emit('vm-refresh-data') }) - this.$router.back() + if (!values.stayonpage) { + this.$router.back() + } }).catch(error => { this.$notifyError(error) + }).finally(() => { this.loading.deploy = false }) })