Some small improvements

This commit is contained in:
2026-01-14 21:57:32 +01:00
parent c03b393cf5
commit b5b7bddb74
3 changed files with 16 additions and 9 deletions

View File

@@ -471,6 +471,7 @@ void setup() {
doc["ledBrightness"] = led_brightness; doc["ledBrightness"] = led_brightness;
doc["ledRgbBrightness"] = rgb_brightness; doc["ledRgbBrightness"] = rgb_brightness;
doc["tempFormat"] = "C"; doc["tempFormat"] = "C";
doc["switchBank"] = 0;
doc["key1"] = keycode[BUTTON_1]; doc["key1"] = keycode[BUTTON_1];
doc["key2"] = keycode[BUTTON_2]; doc["key2"] = keycode[BUTTON_2];
doc["key3"] = keycode[BUTTON_3]; doc["key3"] = keycode[BUTTON_3];
@@ -498,6 +499,8 @@ void setup() {
server.on("/api/status", HTTP_GET, [](AsyncWebServerRequest *request){ server.on("/api/status", HTTP_GET, [](AsyncWebServerRequest *request){
StaticJsonDocument<200> doc; StaticJsonDocument<200> doc;
doc["version"] = VERSION;
int cpu_freq = esp_clk_cpu_freq() / 1000000; int cpu_freq = esp_clk_cpu_freq() / 1000000;
doc["cpuspeed"] = String(cpu_freq) + "MHz"; doc["cpuspeed"] = String(cpu_freq) + "MHz";
@@ -514,6 +517,12 @@ void setup() {
serializeJson(doc, out); serializeJson(doc, out);
request->send(200, "application/json", out); request->send(200, "application/json", out);
}); });
server.on("/api/fwinfo", HTTP_GET, [](AsyncWebServerRequest *request){
StaticJsonDocument<200> doc;
doc["version"] = VERSION;
doc["build_date"] = BUILD_DATE;
doc["build_time"] = BUILD_TIME;
});
server.on("/api/setconfig", HTTP_POST, [](AsyncWebServerRequest *request){ server.on("/api/setconfig", HTTP_POST, [](AsyncWebServerRequest *request){
StaticJsonDocument<100> doc; StaticJsonDocument<100> doc;
doc["status"] = "FAILED"; doc["status"] = "FAILED";

View File

@@ -36,7 +36,7 @@ if (!window.isSecureContext) {
<div class="row"> <div class="row">
<span class="label">Firmware</span> <span class="label">Firmware</span>
<span class="value" id="version">---</span> <span class="value" id="version">---</span>
<button class="infoButton" id="converterInfo">?</button> <button class="infoButton" id="firmwareInfo">?</button>
</div> </div>
<div class="row even"> <div class="row even">
<span class="label">MCU-ID</span> <span class="label">MCU-ID</span>

View File

@@ -1085,14 +1085,12 @@
} }
}); });
} }
buttonHandlers.converterInfo=function() { buttonHandlers.firmwareInfo=function() {
getJson("api/converterInfo").then(function (json) { getJson("api/fwinfo").then(function (json) {
let text = "<h3>Converted entities</h3>"; let text = "<h3>Firmware details</h3>";
text += "<p><b>NMEA0183 to NMEA2000:</b><br/>"; text += "<p><b>Version:</b> " + json.version + "</p>";
text += " " + (json.nmea0183 || "").replace(/,/g, ", "); text += "<p><b>Build date:</b> " + json.build_date + "</p>";
text += "</p>"; text += "<p><b>Build time:</b> " + json.build_time + "</p>";
text += "<p><b>NMEA2000 to NMEA0183:</b><br/>";
text += " " + (json.nmea2000 || "").replace(/,/g, ", ");
text += "</p>"; text += "</p>";
showOverlay(text, true); showOverlay(text, true);
}); });