config-tools: add validation to vuart widget

vuart widget don't have empty line check for required fields.
Added in this patch.

Tracked-On: #7506
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
This commit is contained in:
Wu Zhou
2022-05-18 17:08:29 +08:00
committed by acrnsi-robot
parent c4216a3817
commit eac0e335a8

View File

@@ -9,7 +9,10 @@
<label>VM name: </label>
</b-col>
<b-col md="4">
<b-form-select v-model="VUARTConn.endpoint[0].vm_name" :options="vmNames"></b-form-select>
<b-form-select :state="validation(VUARTConn.endpoint[0].vm_name)" v-model="VUARTConn.endpoint[0].vm_name" :options="vmNames"></b-form-select>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
</b-col>
</b-row>
@@ -24,7 +27,10 @@
<label>VM name: </label>
</b-col>
<b-col md="4">
<b-form-select v-model="VUARTConn.endpoint[1].vm_name" :options="vmNames"></b-form-select>
<b-form-select :state="validation(VUARTConn.endpoint[1].vm_name)" v-model="VUARTConn.endpoint[1].vm_name" :options="vmNames"></b-form-select>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
</b-col>
</b-row>
@@ -33,7 +39,10 @@
<label>Type: </label>
</b-col>
<b-col md="4">
<b-form-select v-model="VUARTConn.type" :options="VuartType"></b-form-select>
<b-form-select :state="validation(VUARTConn.type)" v-model="VUARTConn.type" :options="VuartType"></b-form-select>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
</b-col>
</b-row>
@@ -143,6 +152,9 @@ export default {
}
},
methods: {
validation(value) {
return value.length != 0;
},
removeVUARTConnection(index) {
this.defaultVal.splice(index, 1);
},