diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index bfab5140acd..2f51944d1f0 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1223,6 +1223,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 1af1d48e441..bd1f17b3417 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -615,14 +615,27 @@ @@ -1407,6 +1420,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() @@ -1631,9 +1653,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 }) })