From ea8651cbd631200ea952d15f18808fe75dfd8901 Mon Sep 17 00:00:00 2001 From: Zhao Date: Tue, 31 May 2022 09:41:27 +0800 Subject: [PATCH] config_tools: support add vm_type for a new Service VM For vm_type is a required property, support set vm_type to a new added Service VM. Signed-off-by: Zhao --- .../packages/configurator/src/pages/Config.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue index 4a1ee1f92..9e4f794d7 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue @@ -211,7 +211,14 @@ export default { } } if (this.currentFormData['load_order'] === 'SERVICE_VM') { - delete this.currentFormSchema.BasicConfigType.properties.vm_type + if (this.currentFormData.hasOwnProperty('vm_type')) { + delete this.schemas.ServiceVM.BasicConfigType.properties.vm_type + } else { + if (this.schemas.ServiceVM.BasicConfigType.properties.hasOwnProperty('vm_type') === false) { + this.schemas.ServiceVM.BasicConfigType.properties.vm_type = + {$ref: '#/definitions/BasicVMType', title: 'VM type', description: '

Select the VM type. A standard VM ('} + } + } } }, switchTab(tabVMID) {