diff --git a/Software/data_src/index.htm b/Software/data_src/index.htm
index 5f8b8f4..fea9acf 100644
--- a/Software/data_src/index.htm
+++ b/Software/data_src/index.htm
@@ -122,7 +122,7 @@
@@ -195,7 +195,7 @@
Gerät neustarten
@@ -230,7 +230,7 @@
diff --git a/Software/data_src/static/js/websocket.js b/Software/data_src/static/js/websocket.js
index 060556f..b780d88 100644
--- a/Software/data_src/static/js/websocket.js
+++ b/Software/data_src/static/js/websocket.js
@@ -25,9 +25,7 @@ function initButtons() {
if (elements.length > 0) {
for (var i = 0; i < elements.length; i++) {
let element = elements[i];
- element.addEventListener("click", function () {
- websocket_sendevent("btn-" + element.id, 0);
- });
+ element.addEventListener("click", sendButton);
}
}
}
@@ -55,6 +53,18 @@ function onClose(event) {
overlay.style.display = "flex";
}
+function sendButton(event) {
+ var targetElement = event.target;
+
+ if (
+ targetElement.classList.contains("confirm") &&
+ window.confirm("Sicher?") == false
+ )
+ return;
+
+ websocket_sendevent("btn-" + targetElement.id, targetElement.value);
+}
+
function onMessage(event) {
var data = event.data;
console.log("ws_msg:" + event.data + "\n");
diff --git a/Software/src/webui.cpp b/Software/src/webui.cpp
index 643a66d..f8bbd1a 100644
--- a/Software/src/webui.cpp
+++ b/Software/src/webui.cpp
@@ -492,6 +492,10 @@ void Websocket_HandleButtons(uint8_t *data)
{
globals.systemStatus = sysStat_Shutdown;
}
+ else if (strcmp(identifier, "resettank") == 0)
+ {
+ PersistenceData.tankRemain_microL = LubeConfig.tankCapacity_ml * 1000;
+ }
else
{
Debug_pushMessage("Got unknown Button-id '%s' from ws-client\n", identifier);
@@ -532,6 +536,38 @@ void Websocket_HandleSettings(uint8_t *data)
int index = findIndexByString(value, GPSBaudRateString, GPSBaudRateString_Elements);
LubeConfig.GPSBaudRate = (GPSBaudRate_t)index;
}
+ else if (strcmp(identifier, "ledmaxbrightness") == 0)
+ {
+ LubeConfig.LED_Max_Brightness = atoi(value);
+ }
+ else if (strcmp(identifier, "ledminbrightness") == 0)
+ {
+ LubeConfig.LED_Min_Brightness = atoi(value);
+ }
+ else if (strcmp(identifier, "pumppulse") == 0)
+ {
+ LubeConfig.BleedingPulses = atoi(value);
+ }
+ else if (strcmp(identifier, "tankwarn") == 0)
+ {
+ LubeConfig.TankRemindAtPercentage = atoi(value);
+ }
+ else if (strcmp(identifier, "tankcap") == 0)
+ {
+ LubeConfig.tankCapacity_ml = atoi(value);
+ }
+ else if (strcmp(identifier, "lubedistancerain") == 0)
+ {
+ LubeConfig.DistancePerLube_Rain = atoi(value);
+ }
+ else if (strcmp(identifier, "lubedistancenormal") == 0)
+ {
+ LubeConfig.DistancePerLube_Default = atoi(value);
+ }
+ else if (strcmp(identifier, "ledmodeflash") == 0)
+ {
+ LubeConfig.LED_Mode_Flash = value[0] == '1' ? true : false;
+ }
else
{
Debug_pushMessage("Got unknown Settings-id and value '%s' from ws-client\n", identifier);