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 @@
| 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 @@
}
|