|
@ -18,9 +18,9 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div id="wrapper"> |
|
|
<div id="wrapper"> |
|
|
<div id="content"> |
|
|
<div id="content"> |
|
|
<div><ul id="info"></ul></div> |
|
|
<div id="info" class="col-sm-12 col-md-6 mt-3"></div> |
|
|
<div><ul id="radio"></ul></div> |
|
|
<div id="radio" class="col-sm-12 col-md-6 mt-3"></div> |
|
|
<div id="system"></div> |
|
|
<div id="system" class="mt-3"></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div id="footer"> |
|
|
<div id="footer"> |
|
@ -45,19 +45,29 @@ |
|
|
parseESP(obj); |
|
|
parseESP(obj); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function genTabRow(key, value) { |
|
|
|
|
|
var r = div(["row", "p-1"]); |
|
|
|
|
|
r.appendChild(div(["col"], key)); |
|
|
|
|
|
r.appendChild(div(["col"], value)); |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function parseSysInfo(obj) { |
|
|
function parseSysInfo(obj) { |
|
|
const data = ["sdk", "cpu_freq", "chip_revision", |
|
|
const data = ["sdk", "cpu_freq", "chip_revision", |
|
|
"chip_model", "chip_cores", "esp_type", "mac", "wifi_rssi", |
|
|
"chip_model", "chip_cores", "esp_type", "mac", "wifi_rssi", |
|
|
"flash_size", "sketch_used", "heap_total", "heap_free", "heap_frag", |
|
|
"flash_size", "sketch_used", "heap_total", "heap_free", "heap_frag", |
|
|
"max_free_blk", "version", "core_version", "reboot_reason"]; |
|
|
"max_free_blk", "version", "core_version", "reboot_reason"]; |
|
|
|
|
|
|
|
|
var ul = document.getElementById("info"); |
|
|
var main = document.getElementById("info"); |
|
|
|
|
|
var h = div(["head", "p-2"]); |
|
|
|
|
|
var r = div(["row"]); |
|
|
|
|
|
r.appendChild(div(["col", "a-c"], "System Information")); |
|
|
|
|
|
h.appendChild(r); |
|
|
|
|
|
main.appendChild(h); |
|
|
|
|
|
|
|
|
for (const [key, value] of Object.entries(obj)) { |
|
|
for (const [key, value] of Object.entries(obj)) { |
|
|
if(!data.includes(key) || (typeof value == 'undefined')) continue; |
|
|
if(!data.includes(key) || (typeof value == 'undefined')) continue; |
|
|
var li = document.createElement("li"); |
|
|
main.appendChild(genTabRow(key, value)); |
|
|
li.appendChild() |
|
|
|
|
|
li.appendChild(document.createTextNode(key + ": " + value)); |
|
|
|
|
|
ul.appendChild(li); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -65,21 +75,18 @@ |
|
|
const pa = ["MIN", "LOW", "HIGH", "MAX"]; |
|
|
const pa = ["MIN", "LOW", "HIGH", "MAX"]; |
|
|
const datarate = ["1 MBps", "2 MBps", "250 kbps"]; |
|
|
const datarate = ["1 MBps", "2 MBps", "250 kbps"]; |
|
|
|
|
|
|
|
|
var ul = document.getElementById("radio"); |
|
|
var main = document.getElementById("radio"); |
|
|
let data; |
|
|
var h = div(["head", "p-2"]); |
|
|
|
|
|
var r = div(["row"]); |
|
|
|
|
|
r.appendChild(div(["col", "a-c"], "Radio")); |
|
|
|
|
|
h.appendChild(r); |
|
|
|
|
|
main.appendChild(h); |
|
|
|
|
|
|
|
|
var li = document.createElement("li"); |
|
|
main.appendChild(genTabRow("nrf24l01" + (obj["isPVariant"] ? "+ " : ""), (obj["isconnected"] ? "is connected " : "is not connected "))); |
|
|
li.appendChild(document.createTextNode("nrf24l01" + (obj["isPVariant"] ? "+ " : "") + (obj["isconnected"] ? "is connected " : "is not connected "))); |
|
|
|
|
|
ul.appendChild(li); |
|
|
|
|
|
|
|
|
|
|
|
if(obj["isconnected"]) { |
|
|
if(obj["isconnected"]) { |
|
|
var li = document.createElement("li"); |
|
|
main.appendChild(genTabRow("Datarate", datarate[obj["DataRate"]])); |
|
|
li.appendChild(document.createTextNode("Datarate: " + datarate[obj["DataRate"]])); |
|
|
main.appendChild(genTabRow("Power Level", pa[obj["power_level"]])); |
|
|
ul.appendChild(li); |
|
|
|
|
|
|
|
|
|
|
|
var li = document.createElement("li"); |
|
|
|
|
|
li.appendChild(document.createTextNode("Power Level: " + pa[obj["power_level"]])); |
|
|
|
|
|
ul.appendChild(li); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|