From 2a2771d4e872d0cfe0f42d7713867b929f544c6b Mon Sep 17 00:00:00 2001 From: Florian Grabmeier Date: Wed, 3 Jan 2024 14:25:28 +0100 Subject: [PATCH] Add device info info page Signed-off-by: Florian Grabmeier --- code/main/server_main.cpp | 15 +++++++++ sd-card/html/info.html | 70 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp index f60aedc5c..fd358264b 100644 --- a/code/main/server_main.cpp +++ b/code/main/server_main.cpp @@ -170,6 +170,21 @@ esp_err_t info_get_handler(httpd_req_t *req) httpd_resp_sendstr(req, zw.c_str()); return ESP_OK; } + else if (_task.compare("ChipCores") == 0) + { + httpd_resp_sendstr(req, GetChipCoreCount().c_str()); + return ESP_OK; + } + else if (_task.compare("ChipRevision") == 0) + { + httpd_resp_sendstr(req, GetChipRevision().c_str()); + return ESP_OK; + } + else if (_task.compare("ChipFeatures") == 0) + { + httpd_resp_sendstr(req, GetChipfeatures().c_str()); + return ESP_OK; + } else { char formatted[256]; diff --git a/sd-card/html/info.html b/sd-card/html/info.html index 9ab7d94ab..d01abbec5 100644 --- a/sd-card/html/info.html +++ b/sd-card/html/info.html @@ -79,6 +79,34 @@

Build Info

+ + + + + + +

Device Info

+ + + + + + + + + + + + + +
Chip Cores: + +
Chip Revision: + +
Chip Features: + +
+ @@ -475,6 +503,45 @@

Copyright

xhttp.send(); } + function loadChipCores() + { + url = getDomainname() + '/info?type=ChipCores'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + document.getElementById("chip-cores").value = xhttp.response; + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + + function loadChipRevision() + { + url = getDomainname() + '/info?type=ChipRevision'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + document.getElementById("chip-revision").value = xhttp.response; + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + + function loadChipFeatures() + { + url = getDomainname() + '/info?type=ChipFeatures'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + document.getElementById("chip-features").value = xhttp.response; + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + function init() { loadMemoryInfo(); @@ -493,6 +560,9 @@

Copyright

loadSDCardPartitionSize(); loadSDCardFreePartitionSpace(); loadSDCardPartitionAllocationSize(); + loadChipCores(); + loadChipRevision(); + loadChipFeatures(); } init();