From fe3ca247b9fe95fff3ad473ff61f28e9202d492b Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Sun, 13 Mar 2022 17:37:53 +0100 Subject: [PATCH] Split push config into 2 sections --- html/calibration.htm | 4 +- html/calibration.min.htm | 2 +- html/config.htm | 81 +++++++++++++++++++++++++++++++--------- html/config.min.htm | 2 +- html/format.htm | 8 ++-- html/format.min.htm | 2 +- html/test.htm | 2 +- html/test.min.htm | 2 +- src/main.hpp | 2 +- src/webserver.cpp | 6 ++- 10 files changed, 79 insertions(+), 32 deletions(-) diff --git a/html/calibration.htm b/html/calibration.htm index 807a7ea..fc59cf8 100644 --- a/html/calibration.htm +++ b/html/calibration.htm @@ -74,13 +74,13 @@

-

-
+
diff --git a/html/calibration.min.htm b/html/calibration.min.htm index c478364..dfe3c24 100644 --- a/html/calibration.min.htm +++ b/html/calibration.min.htm @@ -1,4 +1,4 @@ -Beer Gravity Monitor

Here you can create your gravity formula by entering angles/tilt and the corresponding gravity. These values will be saved for future use. Angles with 0 (zero) will be skipped. The values below will be used to check the formula and if the deviation is more than 1.5SG / 0.38P on any of the provided points then the forumla will be rejected. On the bottom of the page you can see a graph over the entered values + values calcualated by the formula.



Here you can create your gravity formula by entering angles/tilt and the corresponding gravity. These values will be saved for future use. Angles with 0 (zero) will be skipped. The values below will be used to check the formula and if the deviation is more than 1.5SG / 0.38P on any of the provided points then the forumla will be rejected. On the bottom of the page you can see a graph over the entered values + values calcualated by the formula.



Temperature Format:





Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file +Beer Gravity Monitor

Temperature Format:




Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/html/format.htm b/html/format.htm index f75e6f7..f9b8ce8 100644 --- a/html/format.htm +++ b/html/format.htm @@ -23,7 +23,7 @@ @@ -62,14 +62,14 @@
-
+

-

-
+
diff --git a/html/format.min.htm b/html/format.min.htm index fd846f4..e080341 100644 --- a/html/format.min.htm +++ b/html/format.min.htm @@ -1,2 +1,2 @@ -Beer Gravity Monitor


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/html/test.htm b/html/test.htm index f3796e9..f4d7230 100644 --- a/html/test.htm +++ b/html/test.htm @@ -23,7 +23,7 @@ diff --git a/html/test.min.htm b/html/test.min.htm index 341f6bb..407d881 100644 --- a/html/test.min.htm +++ b/html/test.min.htm @@ -1 +1 @@ -Beer Gravity Monitor


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file +Beer Gravity Monitor


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/src/main.hpp b/src/main.hpp index a610aa2..cb5f895 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -35,7 +35,7 @@ SOFTWARE. #define PIN_SDA D3 #define PIN_SCL D4 #define PIN_DS D6 -#define PIN_A0 A0 +//#define PIN_A0 A0 #else // defined (ESP32) #if defined (ESPRESSIF32_20) #include diff --git a/src/webserver.cpp b/src/webserver.cpp index da17ca4..fbb6376 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -387,7 +387,7 @@ void WebServerHandler::webHandleConfigDevice() { if (_server->hasArg(PARAM_SLEEP_INTERVAL)) myConfig.setSleepInterval(_server->arg(PARAM_SLEEP_INTERVAL).c_str()); myConfig.saveFile(); - _server->sendHeader("Location", "/config.htm#collapseOne", true); + _server->sendHeader("Location", "/config.htm#collapseDevice", true); _server->send(302, "text/plain", "Device config updated"); LOG_PERF_STOP("webserver-api-config-device"); } @@ -447,7 +447,9 @@ void WebServerHandler::webHandleConfigPush() { if (_server->hasArg(PARAM_PUSH_MQTT_PASS)) myConfig.setMqttPass(_server->arg(PARAM_PUSH_MQTT_PASS).c_str()); myConfig.saveFile(); - _server->sendHeader("Location", "/config.htm#collapseTwo", true); + String section("/config.htm#"); + section += _server->arg("section"); + _server->sendHeader("Location", section.c_str(), true); _server->send(302, "text/plain", "Push config updated"); LOG_PERF_STOP("webserver-api-config-push"); }