[config_tool] vUART widget address for pre-launched VM doesn't update

when the VM of a vUART endpoint changes the configurator can clear its corresponding I/O port or BDF settings automatically

Tracked-On: #8033
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Chuang Ke 2022-08-22 16:12:25 +08:00 committed by acrnsi-robot
parent 0609250743
commit 2e4a373abb
1 changed files with 46 additions and 25 deletions

View File

@ -12,11 +12,14 @@
<IconInfo/>
</template>
<span v-html="this.VMConfigType.properties.name.description"></span>
</n-popover>{{vmNameTitle}}
</n-popover>
{{ vmNameTitle }}
</label>
</b-col>
<b-col md="4">
<b-form-select :state="validation(VUARTConn.endpoint[0].vm_name)" 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"
@input="selectChange(VUARTConn.endpoint[0].vm_name,VUARTConn.endpoint[0],0)"></b-form-select>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
@ -37,11 +40,14 @@
<IconInfo/>
</template>
<span v-html="this.VMConfigType.properties.name.description"></span>
</n-popover>{{vmNameTitle}}:
</n-popover>
{{ vmNameTitle }}:
</label>
</b-col>
<b-col md="4">
<b-form-select :state="validation(VUARTConn.endpoint[1].vm_name)" 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"
@input="selectChange(VUARTConn.endpoint[1].vm_name,VUARTConn.endpoint[1],1)"></b-form-select>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
@ -56,11 +62,13 @@
<IconInfo/>
</template>
<span v-html="this.VuartConnectionType.properties.type.description"></span>
</n-popover>{{vuartConnectionTypeTitle}}:
</n-popover>
{{ vuartConnectionTypeTitle }}:
</label>
</b-col>
<b-col md="4">
<b-form-select :state="validation(VUARTConn.type)" 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>
@ -89,14 +97,17 @@
<IconInfo/>
</template>
<span v-html="this.VuartEndpointType.vbdf.description"></span>
</n-popover>{{vuartVBDFTitle}}
</n-popover>
{{ vuartVBDFTitle }}
</b-col>
</b-row>
<b-row class="justify-content-sm-start align-items-center">
<b-col sm="4"> Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[0].vm_name }}</b-col>
<b-col sm="4">
<b-form-input v-model="VUARTConn.endpoint[0].io_port" v-if="VUARTConn.type === 'legacy'" :placeholder="vIoPortPlaceholder"/>
<b-form-input :state="validateVBDF(VUARTConn.endpoint[0].vbdf)" v-model="VUARTConn.endpoint[0].vbdf" v-else-if="VUARTConn.type === 'pci'" :placeholder="vBDFPlaceholder"/>
<b-form-input v-model="VUARTConn.endpoint[0].io_port" v-if="VUARTConn.type === 'legacy'"
:placeholder="vIoPortPlaceholder"/>
<b-form-input :state="validateVBDF(VUARTConn.endpoint[0].vbdf)" v-model="VUARTConn.endpoint[0].vbdf"
v-else-if="VUARTConn.type === 'pci'" :placeholder="vBDFPlaceholder"/>
<b-form-invalid-feedback>
{{ this.VBDFType["err:pattern"] }}
</b-form-invalid-feedback>
@ -105,8 +116,10 @@
<b-row class="justify-content-sm-start align-items-center">
<b-col sm="4"> Connection_{{ index + 1 }}-{{ VUARTConn.endpoint[1].vm_name }}</b-col>
<b-col sm="4">
<b-form-input v-model="VUARTConn.endpoint[1].io_port" v-if="VUARTConn.type === 'legacy'" :placeholder="vIoPortPlaceholder"/>
<b-form-input :state="validateVBDF(VUARTConn.endpoint[1].vbdf)" v-model="VUARTConn.endpoint[1].vbdf" v-else-if="VUARTConn.type === 'pci'" :placeholder="vBDFPlaceholder"/>
<b-form-input v-model="VUARTConn.endpoint[1].io_port" v-if="VUARTConn.type === 'legacy'"
:placeholder="vIoPortPlaceholder"/>
<b-form-input :state="validateVBDF(VUARTConn.endpoint[1].vbdf)" v-model="VUARTConn.endpoint[1].vbdf"
v-else-if="VUARTConn.type === 'pci'" :placeholder="vBDFPlaceholder"/>
<b-form-invalid-feedback>
{{ this.VBDFType["err:pattern"] }}
</b-form-invalid-feedback>
@ -180,6 +193,7 @@ export default {
let epTypeProp = this.rootSchema.definitions.VuartEndpointType.properties
let conTypeProp = this.rootSchema.definitions.VuartConnectionType.properties
return {
selected: {0: {oldValue: ""}, 1: {oldValue: ""}},
VuartEndpointType: this.rootSchema.definitions['VuartEndpointType']['properties'],
vmNameTitle: epTypeProp.vm_name.title,
vuartConnectionTypeTitle: conTypeProp.type.title,
@ -244,7 +258,14 @@ export default {
}
]
})
},
selectChange(value, obj, endpoint) {
if (this.selected[endpoint].oldValue != value) {
obj.vbdf = ""
obj.io_port = ""
}
this.selected[endpoint].oldValue = value
},
}
};
</script>