|
@@ -248,296 +248,107 @@ Copyright © 2020 - 2024 by <a href="https://github.com/jomjol/AI-on-the-edg
|
|
|
</html>
|
|
</html>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
-
|
|
|
|
|
- function loadLastRestart()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/starttime';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- //Input format: 19700101-010019
|
|
|
|
|
- var timestamp = xhttp.response.substr(6,2) + "." +
|
|
|
|
|
- xhttp.response.substr(4,2) + "." +
|
|
|
|
|
- xhttp.response.substr(0,4) + " " +
|
|
|
|
|
- xhttp.response.substr(9,2) + ":" +
|
|
|
|
|
- xhttp.response.substr(11,2) + ":" +
|
|
|
|
|
- xhttp.response.substr(13,2);
|
|
|
|
|
- document.getElementById("starttime").value = timestamp;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadUptime()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/uptime';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("uptime").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadFWVersion()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=FirmwareVersion';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("firmware").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadFWBuildTime()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=BuildTime';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- // Input format: 2023-04-02 10:56
|
|
|
|
|
- var timestamp = xhttp.response.substr(8,2) + "." +
|
|
|
|
|
- xhttp.response.substr(5,2) + "." +
|
|
|
|
|
- xhttp.response.substr(0,4) + " " +
|
|
|
|
|
- xhttp.response.substr(11,2) + ":" +
|
|
|
|
|
- xhttp.response.substr(14,2);
|
|
|
|
|
- document.getElementById("build-time").value = timestamp;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadHTMLVersion()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=HTMLVersion';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("web-ui").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadHostname()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=Hostname';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("hostname").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadIPAddress()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=IP';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("IP-address").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadWLANSSID()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SSID';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("wlan-ssid").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardManufacturer()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardManufacturer';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardManufacturer").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardName()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardName';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardName").value = xhttp.response;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardCapacity()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardCapacity';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardCapacity").value = xhttp.response + " MB";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardSectorSize()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardSectorSize';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardSectorSize").value = xhttp.response + " byte";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardPartitionSize()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardPartitionSize';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardPartitionSize").value = xhttp.response + " MB";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardFreePartitionSpace()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardFreePartitionSpace';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardFreePartitionSpace").value = xhttp.response + " MB";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadSDCardPartitionAllocationSize()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/info?type=SDCardPartitionAllocationSize';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- document.getElementById("SDCardPartitionAllocationSize").value = xhttp.response + " byte";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- xhttp.send();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function loadMemoryInfo()
|
|
|
|
|
- {
|
|
|
|
|
- url = getDomainname() + '/heap';
|
|
|
|
|
- var xhttp = new XMLHttpRequest();
|
|
|
|
|
- xhttp.onreadystatechange = function() {
|
|
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
- data = xhttp.response.split("|");
|
|
|
|
|
- document.getElementById("RAMTotalFree").value = data[0].split("l: ")[1] + " byte";
|
|
|
|
|
- document.getElementById("IntRAMFree").value = data[4].split(":")[1] + " byte";
|
|
|
|
|
- document.getElementById("IntRAMLargestFree").value = data[5].split(":")[1] + " byte";
|
|
|
|
|
- document.getElementById("IntRAMMinFree").value = data[6].split(":")[1] + " byte";
|
|
|
|
|
- document.getElementById("ExtRAMFree").value = data[1].split(":")[1] + " byte";
|
|
|
|
|
- document.getElementById("ExtRAMLargestFree").value = data[2].split(":")[1] + " byte";
|
|
|
|
|
- document.getElementById("ExtRAMMinFree").value = data[3].split(":")[1] + " byte";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- xhttp.open("GET", url, true);
|
|
|
|
|
- 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();
|
|
|
|
|
- loadLastRestart();
|
|
|
|
|
- loadUptime();
|
|
|
|
|
- loadFWVersion();
|
|
|
|
|
- loadFWBuildTime();
|
|
|
|
|
- loadHTMLVersion();
|
|
|
|
|
- loadHostname();
|
|
|
|
|
- loadIPAddress();
|
|
|
|
|
- loadWLANSSID();
|
|
|
|
|
- loadSDCardManufacturer();
|
|
|
|
|
- loadSDCardName();
|
|
|
|
|
- loadSDCardCapacity();
|
|
|
|
|
- loadSDCardSectorSize();
|
|
|
|
|
- loadSDCardPartitionSize();
|
|
|
|
|
- loadSDCardFreePartitionSpace();
|
|
|
|
|
- loadSDCardPartitionAllocationSize();
|
|
|
|
|
- loadChipCores();
|
|
|
|
|
- loadChipRevision();
|
|
|
|
|
- loadChipFeatures();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- init();
|
|
|
|
|
|
|
+ function setOutput(id, value, suffix)
|
|
|
|
|
+ {
|
|
|
|
|
+ var field = document.getElementById(id);
|
|
|
|
|
+ if (!field) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (value === undefined || value === null || value === "") {
|
|
|
|
|
+ field.value = "N/A";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ field.value = String(value) + (suffix || "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function formatStartTime(value)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!value || value.length < 15) {
|
|
|
|
|
+ return value || "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Input format: YYYYMMDD-HHMMSS
|
|
|
|
|
+ return value.substr(6, 2) + "." +
|
|
|
|
|
+ value.substr(4, 2) + "." +
|
|
|
|
|
+ value.substr(0, 4) + " " +
|
|
|
|
|
+ value.substr(9, 2) + ":" +
|
|
|
|
|
+ value.substr(11, 2) + ":" +
|
|
|
|
|
+ value.substr(13, 2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function formatBuildTime(value)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!value || value.length < 16) {
|
|
|
|
|
+ return value || "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Input format: YYYY-MM-DD HH:MM
|
|
|
|
|
+ return value.substr(8, 2) + "." +
|
|
|
|
|
+ value.substr(5, 2) + "." +
|
|
|
|
|
+ value.substr(0, 4) + " " +
|
|
|
|
|
+ value.substr(11, 2) + ":" +
|
|
|
|
|
+ value.substr(14, 2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function loadSystemInfo()
|
|
|
|
|
+ {
|
|
|
|
|
+ var request = new XMLHttpRequest();
|
|
|
|
|
+ request.onreadystatechange = function() {
|
|
|
|
|
+ if (this.readyState !== 4) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.status !== 200) {
|
|
|
|
|
+ console.error("Could not load system information:", this.status);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ var response = JSON.parse(this.responseText);
|
|
|
|
|
+ var info = Array.isArray(response) ? response[0] : response;
|
|
|
|
|
+ if (!info || typeof info !== "object") {
|
|
|
|
|
+ throw new Error("Invalid system information response");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ setOutput("starttime", formatStartTime(info.starttime));
|
|
|
|
|
+ setOutput("uptime", info.uptime);
|
|
|
|
|
+ setOutput("firmware", info.firmware);
|
|
|
|
|
+ setOutput("build-time", formatBuildTime(info.buildtime));
|
|
|
|
|
+ setOutput("web-ui", info.html);
|
|
|
|
|
+
|
|
|
|
|
+ setOutput("chip-cores", info.chipCores);
|
|
|
|
|
+ setOutput("chip-revision", info.chipRevision);
|
|
|
|
|
+ setOutput("chip-features", info.chipFeatures);
|
|
|
|
|
+
|
|
|
|
|
+ setOutput("hostname", info.hostname);
|
|
|
|
|
+ setOutput("IP-address", info.IPv4);
|
|
|
|
|
+ setOutput("wlan-ssid", info.SSID);
|
|
|
|
|
+
|
|
|
|
|
+ setOutput("SDCardManufacturer", info.sdCardManufacturer);
|
|
|
|
|
+ setOutput("SDCardName", info.sdCardName);
|
|
|
|
|
+ setOutput("SDCardCapacity", info.sdCardCapacity, " MB");
|
|
|
|
|
+ setOutput("SDCardSectorSize", info.sdCardSectorSize, " byte");
|
|
|
|
|
+ setOutput("SDCardPartitionSize", info.sdCardPartitionSize, " MB");
|
|
|
|
|
+ setOutput("SDCardFreePartitionSpace", info.sdCardFreePartitionSpace, " MB");
|
|
|
|
|
+ setOutput("SDCardPartitionAllocationSize", info.sdCardPartitionAllocationSize, " byte");
|
|
|
|
|
+
|
|
|
|
|
+ setOutput("RAMTotalFree", info.RAMTotalFree, " byte");
|
|
|
|
|
+ setOutput("ExtRAMFree", info.ExtRAMFree, " byte");
|
|
|
|
|
+ setOutput("ExtRAMLargestFree", info.ExtRAMLargestFree, " byte");
|
|
|
|
|
+ setOutput("ExtRAMMinFree", info.ExtRAMMinFree, " byte");
|
|
|
|
|
+ setOutput("IntRAMFree", info.IntRAMFree, " byte");
|
|
|
|
|
+ setOutput("IntRAMLargestFree", info.IntRAMLargestFree, " byte");
|
|
|
|
|
+ setOutput("IntRAMMinFree", info.IntRAMMinFree, " byte");
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error("Could not parse system information:", error);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ request.open("GET", getDomainname() + "/sysinfo", true);
|
|
|
|
|
+ request.send();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ loadSystemInfo();
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|