config-tools: add validation to vuart widget
vuart widget don't have empty line check for required fields.
Added in this patch.
<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>
<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>
<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);
},
