From e322b7029155dff3c61efea52b9ddbe0fa410b3d 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 9153ecfc4..19aa8408c 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 @@ -12,7 +12,7 @@ - VM name: + {{vmNameTitle}} @@ -37,7 +37,7 @@ - VM name: + {{vmNameTitle}}: @@ -56,7 +56,7 @@ - Type: + {{vuartConnectionTypeTitle}}: @@ -72,7 +72,7 @@

- Virtual UART port: + {{vuartEndpointTitle}}: @@ -81,7 +81,7 @@ - I/O address: + {{vuartVIoPortTitle}}: @@ -89,21 +89,21 @@ {{this.VuartEndpointType.vbdf.description}} - VBDF + {{vuartVBDFTitle}} Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[0].vm_name }} - - + + Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[1].vm_name }} - - + + @@ -165,9 +165,24 @@ 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'], VuartEndpointType: this.rootSchema.definitions['VuartEndpointType']['properties'], + 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'], VMConfigType: this.rootSchema.definitions['VMConfigType'], VuartConnectionType: this.rootSchema.definitions['VuartConnectionType'], diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd index a14c89caa..b9259377e 100644 --- a/misc/config_tools/schema/VMtypes.xsd +++ b/misc/config_tools/schema/VMtypes.xsd @@ -216,12 +216,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. @@ -240,7 +240,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. - + + + +