config_tool: Move "BIOS Revision" line in Configurator UI

Placed the "BIOS Revision:" at the top line of BIOS
information, and change the order of the information to have
the board information to the left, and BIOS information to the right.

Tracked-On: #7884
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
This commit is contained in:
Ziheng Li 2022-07-11 11:00:44 +08:00 committed by acrnsi-robot
parent df41ce807f
commit d5f3643e4f
1 changed files with 35 additions and 1 deletions

View File

@ -46,8 +46,8 @@
<div class="card-body">
<div class="card-text text-pre-line">
<div class="px-3 py-2 row">
<div class="py-1 col-sm">{{ this.imported ? this.board.BIOS_INFO : '' }}</div>
<div class="py-1 col-sm">{{ this.imported ? this.board.BASE_BOARD_INFO : '' }}</div>
<div class="py-1 col-sm">{{ this.imported ? this.board.BIOS_INFO : '' }}</div>
</div>
</div>
</div>
@ -107,6 +107,7 @@ export default {
},
computed: {
imported() {
this.reformatBoardInfo()
return !_.isEmpty(this.board)
}
},
@ -158,6 +159,39 @@ export default {
})
}
},
reformatBoardInfo() {
// move BIOS Revision info into the top line
if (this.board.BIOS_INFO != null) {
let biosinfo = this.board.BIOS_INFO.split('\n')
let revindex, infoindex = -1
for (let [index, element] of biosinfo.entries()) {
if (element.includes("Revision")) {
revindex = index
}
// add a ":" in line "BIOS Information"
if (element.includes("Information")) {
infoindex = index
biosinfo[index] = biosinfo[index] + ":"
}
}
if (revindex !== -1 && infoindex !== -1) {
let temp = biosinfo[revindex]
biosinfo.splice(revindex, 1)
biosinfo.splice(infoindex + 1, 0, temp)
}
this.board.BIOS_INFO = biosinfo.join('\n')
}
// add a ":" in line "Base Board Information"
if (this.board.BASE_BOARD_INFO != null) {
let boardinfo = this.board.BASE_BOARD_INFO.split('\n')
for (let [index, element] of boardinfo.entries()) {
if (element.includes("Information")) {
boardinfo[index] = boardinfo[index] + ":"
}
}
this.board.BASE_BOARD_INFO = boardinfo.join('\n')
}
},
getExistBoardPath() {
// only return filename when using exist configuration.
return configurator.readDir(this.WorkingFolder, false)