diff --git a/simpleadmin/www/index.html b/simpleadmin/www/index.html index 2dd45d1..abee817 100644 --- a/simpleadmin/www/index.html +++ b/simpleadmin/www/index.html @@ -1196,11 +1196,11 @@ currentNetworkMode == "5G SA FDD" ) { // TAC - this.tac = lines + const localTac = lines .find((line) => line.includes('+QENG: "servingcell"')) .split(",")[8] .replace(/"/g, ""); - + this.tac = parseInt(localTac, 10) + "(" + localTac + ")"; // CSQ this.csq = "NR-SA Mode"; @@ -1250,11 +1250,11 @@ } else { // LTE Only // TAC - this.tac = lines + const localTac = lines .find((line) => line.includes('+QENG: "servingcell"')) .split(",")[12] .replace(/"/g, ""); - + this.tac = parseInt(localTac, 10) + "(" + localTac + ")"; // CSQ this.csq = lines .find((line) => line.includes("+CSQ:")) @@ -1354,11 +1354,24 @@ ")"; // TAC - this.tac = lines + const localTac = lines .find((line) => line.includes('+QENG: "LTE"')) .split(",")[10] .replace(/"/g, ""); + this.tac = parseInt(localTac, 10) + "("+localTac+")"; + this.cellID = + "Short " + + shortCID + + "(" + + parseInt(shortCID, 16) + + ")" + + ", " + + "Long " + + longCID + + "(" + + parseInt(longCID, 16) + + ")"; // CSQ this.csq = lines .find((line) => line.includes("+CSQ:")) @@ -1489,32 +1502,37 @@ }, calculate_lte_bw(lte_bw) { - switch (true) { - case 0: - return 1.4; - case 1: - return 3; - // Now case 2 - 5 - case lte_bw >= 2 && lte_bw <= 5: - return (lte_bw - 1) * 5; - default: - return "Unknown"; - } + const BANDWIDTH_MAP = { + 0: 1.4, + 1: 3, + 2: 5, + 3: 10, + 4: 15, + 5: 20, + 6: 40, + 7: 80, + 8: 100, + 9: 200, + }; + return BANDWIDTH_MAP[lte_bw]; }, calculate_nr_bw(nr_bw) { - switch (true) { - case nr_bw >= 0 && nr_bw <= 5: - return (nr_bw + 1) * 5; - case nr_bw >= 6 && nr_bw <= 12: - return (nr_bw - 2) * 10; - case nr_bw === 13: - return "200"; - case nr_bw === 14: - return "400"; - default: - return "Unknown"; - } + const NR_BANDWIDTH_MAP = { + 0: 5, + 1: 10, + 2: 15, + 3: 20, + 4: 25, + 5: 30, + 6: 40, + 7: 50, + 8: 60, + 9: 80, + 10: 100, + 11: 200, + }; + return NR_BANDWIDTH_MAP[nr_bw]; }, calculateRSRPPercentage(rsrp) {