misc: configurator: report the errors on clicking save button

On clicking save button, current scenario configuration is validated and
errors should be prompted out if any.

BTW, fix unrecognized value in cpu affinity object.

Fixes: 5a3b38f778 ("config-tools: add confirm message")
Tracked-On: #7469
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
This commit is contained in:
Calvin Zhang 2022-05-12 15:13:37 +08:00 committed by acrnsi-robot
parent 7750a6c25b
commit e4f11ca4c8
2 changed files with 6 additions and 3 deletions

View File

@ -358,7 +358,10 @@ export default {
configurator.writeFile(this.WorkingFolder + 'scenario.xml', scenarioXMLData)
.then(() => {
step = 1
configurator.pythonObject.validateScenario(this.board.content, scenarioXMLData)
this.errors = configurator.pythonObject.validateScenario(this.board.content, scenarioXMLData)
if (this.errors.length != 0) {
throw "validation failed"
}
})
.then(() => {
step = 2

View File

@ -114,7 +114,7 @@ export default {
return `${this.rootFormData.name} vCPU ${index}`
},
addPCPU(index) {
this.defaultVal.pcpu.splice(index + 1, 0, {pcpu_id: null, real_time_vcpu: false})
this.defaultVal.pcpu.splice(index + 1, 0, {pcpu_id: null, real_time_vcpu: "n"})
},
removePCPU(index) {
if (this.defaultVal.pcpu.length === 1) {
@ -144,4 +144,4 @@ export default {
background: #f9f9f9;
padding: 5px 5px 3px;
}
</style>
</style>