mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-30 01:06:11 +02:00
improved system infos - not yet nice but informal
This commit is contained in:
parent
033d9f04e6
commit
0305c114cf
3 changed files with 53 additions and 48 deletions
|
@ -31,32 +31,6 @@ function parseESP(obj) {
|
|||
document.getElementById("esp_type").innerHTML="Board: " + obj["esp_type"];
|
||||
}
|
||||
|
||||
function parseSysInfo(obj) {
|
||||
const data = ["sdk_version", "cpu_freq", "chip_revision", "chip_model", "chip_cores", "esp_type"];
|
||||
|
||||
var ul = document.getElementById("info");
|
||||
|
||||
if(!isNaN(obj["heap_total"])) {
|
||||
document.getElementById("info").innerHTML = 'Heap:<progress id="heap" max="100" value="0"></progress> <span id="heap_used"></span> bytes (<span id="heap_total"></span> bytes)';
|
||||
changeProgressbar("heap", obj["heap_used"], obj["heap_total"]);
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if(!data.includes(key) || (typeof value == 'undefined')) continue;
|
||||
var li = document.createElement("li");
|
||||
li.appendChild(document.createTextNode(key + ": " + value));
|
||||
ul.appendChild(li);
|
||||
}
|
||||
}
|
||||
|
||||
function changeProgressbar(id, value, max) {
|
||||
document.getElementById(id).value = value;
|
||||
document.getElementById(id).max = max;
|
||||
|
||||
document.getElementById("heap_used").textContent = value;
|
||||
document.getElementById("heap_total").textContent = max;
|
||||
}
|
||||
|
||||
function setHide(id, hide) {
|
||||
var elm = document.getElementById(id);
|
||||
if(hide) {
|
||||
|
@ -67,7 +41,6 @@ function setHide(id, hide) {
|
|||
elm.classList.remove('hide');
|
||||
}
|
||||
|
||||
|
||||
function toggle(id) {
|
||||
var e = document.getElementById(id);
|
||||
if(!e.classList.contains("hide"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue