From ab51dcdab428872afcaed0152ee26f076a188081 Mon Sep 17 00:00:00 2001 From: Conghui Date: Fri, 6 May 2022 11:04:42 +0800 Subject: [PATCH] config-tools: show confirm info for deleting VMs Show different confirm windows for Service_VM and other VMs. Tracked-On: #7413 Signed-off-by: Conghui --- .../configurator/src/pages/Config.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/misc/config_tools/configurator/src/pages/Config.vue b/misc/config_tools/configurator/src/pages/Config.vue index b40231aa8..60badfde0 100644 --- a/misc/config_tools/configurator/src/pages/Config.vue +++ b/misc/config_tools/configurator/src/pages/Config.vue @@ -177,14 +177,27 @@ export default { }, deleteVM() { let currentVMIndex = -1; + let vmConfigcurrent = [] + let msg='' this.scenario.vm.map((vmConfig, vmIndex) => { if (vmConfig['@id'] === this.activeVMID) { currentVMIndex = vmIndex + vmConfigcurrent = vmConfig + } + }) + if (vmConfigcurrent['load_order'] === 'SERVICE_VM') { + msg = "Post-launched VMs require the Service VM. If you proceed, all post-launched VMs and their settings will also be deleted. Are you sure you want to proceed?" + } else { + msg = `Delete this virtual machine VM${this.activeVMID}?` + } + confirm(msg).then((r) => { + if (r) { + console.log("remove VM") + this.scenario.vm.splice(currentVMIndex, 1); + this.updateCurrentFormSchema() + this.updateCurrentFormData() } }) - this.scenario.vm.splice(currentVMIndex, 1); - this.updateCurrentFormSchema() - this.updateCurrentFormData() }, scenarioConfigFormDataUpdate(vmid, data) { if (vmid === -1) {