From 1f0c5a022895eb65534cde7a7f77ec0fcf28734d Mon Sep 17 00:00:00 2001 From: Wu Zhou Date: Wed, 25 May 2022 18:54:27 +0800 Subject: [PATCH] config-tools: refine the vuart widget's text The labels and titles in vuart widget are hard-coded in the .vue file rather than exposing the text from XSD file. This patch fixed it. Tracked-On: #7562 Signed-off-by: Wu Zhou --- .../Config/ConfigForm/CustomWidget/VUART.vue | 37 +++++++++++++------ misc/config_tools/schema/VMtypes.xsd | 9 +++-- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/VUART.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/VUART.vue index 4ce10f741..7901395ad 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/VUART.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/VUART.vue @@ -6,7 +6,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -51,23 +51,23 @@

- Virtual UART port: + {{vuartEndpointTitle}}: - I/O address: - VBDF + {{vuartVIoPortTitle}}: + {{vuartVBDFTitle}}: Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[0].vm_name }} - - + + Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[1].vm_name }} - - + + @@ -128,8 +128,23 @@ export default { } }, data() { + let enumValue = this.rootSchema.definitions['VuartType']['enum'] + let enumNames = this.rootSchema.definitions['VuartType']['enumNames'] + let VuartType = [] + enumValue.forEach((item, i) => { + VuartType.push({value:item, text:enumNames[i]}) + }) + let epTypeProp = this.rootSchema.definitions.VuartEndpointType.properties + let conTypeProp = this.rootSchema.definitions.VuartConnectionType.properties return { - VuartType: this.rootSchema.definitions['VuartType']['enum'], + vmNameTitle: epTypeProp.vm_name.title, + vuartConnectionTypeTitle: conTypeProp.type.title, + vuartEndpointTitle: conTypeProp.endpoint['title'], + vuartVIoPortTitle: epTypeProp.io_port.title, + vuartVBDFTitle: epTypeProp.vbdf.title, + vIoPortPlaceholder: epTypeProp.io_port['ui:options']['placeholder'], + vBDFPlaceholder: epTypeProp.vbdf['ui:options']['placeholder'], + VuartType, IOPortDefault: this.rootSchema.definitions['VuartEndpointType']['properties']['io_port']['default'], defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath) }; diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd index ea612e144..e89d248de 100644 --- a/misc/config_tools/schema/VMtypes.xsd +++ b/misc/config_tools/schema/VMtypes.xsd @@ -227,12 +227,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab. - + Specify the COM base for each legacy virtual UART. - + Specify the virtual Bus:Device.Function (BDF) for each PCI virtual UART. Virtual BDF is automatically assigned when the configuration is saved and can be changed if needed. @@ -251,7 +251,10 @@ The size is a subset of the VM's total memory size specified on the Basic tab.Select the communication virtual UART (vUART) type. - + + + +