diff --git a/simpleadmin/www/deviceinfo.html b/simpleadmin/www/deviceinfo.html index 985c3e1..95bbb15 100644 --- a/simpleadmin/www/deviceinfo.html +++ b/simpleadmin/www/deviceinfo.html @@ -45,6 +45,9 @@ + diff --git a/simpleadmin/www/index.html b/simpleadmin/www/index.html index 94166c0..cc64fd7 100644 --- a/simpleadmin/www/index.html +++ b/simpleadmin/www/index.html @@ -50,6 +50,9 @@ + @@ -275,6 +278,10 @@ Assesment + + Traffic Stats + + CSQ @@ -292,14 +299,12 @@ TAC4G/5G - + + SS_RSRQ4G - + SS_RSRQ5G + RSRP4G - + SS_RSRP5G - + SINR4G - + SINR5G line.includes('+QENG: "servingcell"')) .split(",")[2] .replace(/"/g, ""); - + const duplex_mode = lines .find((line) => line.includes('+QENG: "servingcell"')) .split(",")[3] @@ -842,7 +843,10 @@ } // --- Bandwidth --- - if (this.networkMode == "5G SA TDD" || this.networkMode == "5G SA FDD") { + if ( + this.networkMode == "5G SA TDD" || + this.networkMode == "5G SA FDD" + ) { // find this example value from lines "+QENG: \"servingcell\" const bandwidth_line = lines.find((line) => line.includes('+QENG: "servingcell"') @@ -906,7 +910,10 @@ } // --- E/ARFCN --- - if (this.networkMode == "5G SA TDD" || this.networkMode == "5G SA FDD") { + if ( + this.networkMode == "5G SA TDD" || + this.networkMode == "5G SA FDD" + ) { // find this value from lines "+QCAINFO: \"PCC\" const nr_pcc_arfcn = lines .find((line) => line.includes('+QCAINFO: "PCC"')) @@ -998,7 +1005,10 @@ } // --- PCI --- - if (this.networkMode == "5G SA TDD" || this.networkMode == "5G SA FDD") { + if ( + this.networkMode == "5G SA TDD" || + this.networkMode == "5G SA FDD" + ) { const nr_pcc_pci = lines .find((line) => line.includes('+QCAINFO: "PCC"')) .split(",")[4]; @@ -1111,6 +1121,44 @@ .split(",")[4] .replace(/"/g, ""); + // Traffic Stats + // for NR traffic stats: +QGDNRCNT: 3263753367,109876105 + this.nrDownload = lines + .find((line) => line.includes("+QGDNRCNT:")) + .split(",")[0] + // remove the +QGDNRCNT: part + .replace("+QGDNRCNT: ", ""); + + this.nrUpload = lines + .find((line) => line.includes("+QGDNRCNT:")) + .split(",")[1]; + + + // for non-NR traffic stats: +QGDCNT: 247357510,6864571506 + this.nonNrDownload = lines + .find((line) => line.includes("+QGDCNT:")) + .split(",")[1]; + + this.nonNrUpload = lines + .find((line) => line.includes("+QGDCNT:")) + .split(",")[0] + // remove the +QGDCNT: part + .replace("+QGDCNT: ", ""); + + + // Add the nrDownload and nonNrDownload together + this.downloadStat = parseInt(this.nrDownload) + parseInt(this.nonNrDownload); + + // Add the nrUpload and nonNrUpload together + this.uploadStat = parseInt(this.nrUpload) + parseInt(this.nonNrUpload); + + // Convert the downloadStat and uploadStat bytes to readable size + this.downloadStat = this.bytesToSize(this.downloadStat); + this.uploadStat = this.bytesToSize(this.uploadStat); + + console.log(this.downloadStat); + console.log(this.uploadStat); + // Signal Informations const currentNetworkMode = this.networkMode; @@ -1133,8 +1181,11 @@ // Get the short Cell ID (Last 2 characters of the Cell ID) const shortCID = longCID.substring(longCID.length - 2); - - if (currentNetworkMode == "5G SA TDD" || currentNetworkMode == "5G SA FDD") { + + if ( + currentNetworkMode == "5G SA TDD" || + currentNetworkMode == "5G SA FDD" + ) { // TAC this.tac = lines .find((line) => line.includes('+QENG: "servingcell"')) @@ -1214,11 +1265,11 @@ .split(",")[14] .replace(/"/g, ""); - // RSSI - this.rssi = lines - .find((line) => line.includes('+QENG: "servingcell"')) - .split(",")[15] - .replace(/"/g, ""); + // // RSSI + // this.rssi = lines + // .find((line) => line.includes('+QENG: "servingcell"')) + // .split(",")[15] + // .replace(/"/g, ""); // SINR this.sinrLTE = lines @@ -1318,11 +1369,11 @@ .split(",")[12] .replace(/"/g, ""); - // RSSI LTE - this.rssi = lines - .find((line) => line.includes('+QENG: "LTE"')) - .split(",")[13] - .replace(/"/g, ""); + // // RSSI LTE + // this.rssi = lines + // .find((line) => line.includes('+QENG: "LTE"')) + // .split(",")[13] + // .replace(/"/g, ""); // SINR LTE this.sinrLTE = lines @@ -1408,6 +1459,13 @@ }); }, + bytesToSize(bytes) { + const sizes = ["Bytes", "KB", "MB", "GB", "TB"]; + if (bytes == 0) return "0 Byte"; + const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); + return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i]; + }, + requestPing() { return fetch("/cgi-bin/get_ping") .then((response) => response.text()) @@ -1759,4 +1817,4 @@ } - \ No newline at end of file + diff --git a/simpleadmin/www/logout.html b/simpleadmin/www/logout.html deleted file mode 100644 index 6566a50..0000000 --- a/simpleadmin/www/logout.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - Logging out... - - - - - - - - - - - - - - diff --git a/simpleadmin/www/network.html b/simpleadmin/www/network.html index e1aa427..9c03b54 100644 --- a/simpleadmin/www/network.html +++ b/simpleadmin/www/network.html @@ -53,6 +53,9 @@ >Simple Network + @@ -156,6 +159,28 @@ x-bind:placeholder="apn === '-' ? 'Fetching...' : apn" /> + + +
@@ -378,6 +403,10 @@
+ @@ -697,7 +726,7 @@ // If atcmd has QUIMSLOT, do a reboot instead if (atcmd.includes("QUIMSLOT")) { - atcmd = atcmd +"+CFUN=1,1"; + atcmd = atcmd + "+CFUN=1,1"; this.sendATcommand(atcmd); this.countdown = 45; diff --git a/simpleadmin/www/scanner.html b/simpleadmin/www/scanner.html index c1f4ace..9ad19ad 100644 --- a/simpleadmin/www/scanner.html +++ b/simpleadmin/www/scanner.html @@ -20,6 +20,8 @@ + +
@@ -51,11 +53,14 @@ + @@ -76,6 +81,23 @@ + +
+
+
+
Live Signal
+
+
+

Signal Graph

+
+ +
+
+
+
+
+
+
@@ -2311,6 +2333,61 @@ }, }; } + + const ctx = document.getElementById("myChart"); + + new Chart(ctx, { + type: "line", + data: { + labels: [ + "0m", + "1m", + "2m", + "3m", + "4m", + "5m", + "6m", + "7m", + "8m", + "9m", + "10m", + "11m", + "12m", + "13m", + "14m", + "15m", + + ], + datasets: [ + { + label: "LTE", + data: [0, 10, 5, 2, 20, 30, 45, 50, 60, 70, 80], + borderColor: "rgb(255, 99, 132)", + backgroundColor: "rgba(255, 99, 132, 0.5)", + borderWidth: 1, + }, + { + label: "NR5G", + data: [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50], + borderColor: "rgb(54, 162, 235)", + backgroundColor: "rgba(54, 162, 235, 0.5)", + borderWidth: 1, + }, + ], + options: { + responsive: true, + plugins: { + legend: { + position: "top", + }, + title: { + display: true, + text: "Chart.js Line Chart", + }, + }, + }, + }, + }); diff --git a/simpleadmin/www/settings.html b/simpleadmin/www/settings.html index 16ee78d..644fea9 100644 --- a/simpleadmin/www/settings.html +++ b/simpleadmin/www/settings.html @@ -41,6 +41,9 @@ +
- -
+ --> diff --git a/simpleadmin/www/sms.html b/simpleadmin/www/sms.html index 8c41fde..4ab01a9 100644 --- a/simpleadmin/www/sms.html +++ b/simpleadmin/www/sms.html @@ -35,6 +35,9 @@ + diff --git a/simpleadmin/www/watchcat.html b/simpleadmin/www/watchcat.html index 5c83dd3..923e60b 100644 --- a/simpleadmin/www/watchcat.html +++ b/simpleadmin/www/watchcat.html @@ -49,6 +49,9 @@ +