From d5f3643e4ffe2b6d1e05f98f78707926c9bd0103 Mon Sep 17 00:00:00 2001 From: Ziheng Li Date: Mon, 11 Jul 2022 11:00:44 +0800 Subject: [PATCH] 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 --- .../configurator/src/pages/Config/Board.vue | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/Board.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/Board.vue index 1859eeb96..ecc6e606e 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/Board.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/Board.vue @@ -46,8 +46,8 @@
-
{{ this.imported ? this.board.BIOS_INFO : '' }}
{{ this.imported ? this.board.BASE_BOARD_INFO : '' }}
+
{{ this.imported ? this.board.BIOS_INFO : '' }}
@@ -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)