%FOOTER%)";
@@ -83,6 +84,7 @@ void SetupWebserver() {
webserver.on("/", HTTP_GET, WebPage_root);
webserver.on("/cangrow.css", HTTP_GET, WebFile_cangrow_CSS);
webserver.on("/wifiSettings", HTTP_GET, WebPage_wifi);
+ webserver.on("/wifiSettings", HTTP_POST, WebPage_wifi);
requestLogger.setOutput(Serial);
// this activates the middleware
@@ -100,7 +102,7 @@ void SetupWebserver() {
// call the network scan once, so there are some values at the first call
// of the wifi settings page. otherwise the first call of the wifi scan would return
// an empty list of networks
- Serial.println(":: [Webserver] call [wifi:ScanNetworks] to workaround empty results bug");
+ Serial.println(":: [Webserver] call [wifi:ScanNetworks] to workaround empty scan results bug");
WebPage_wifi_ScanNetworks();
webserver.begin();
diff --git a/Arduino/CanGrow/include/Webserver/.h b/Arduino/CanGrow/include/Webserver/.h
deleted file mode 100644
index e69de29..0000000
diff --git a/Arduino/CanGrow/include/Webserver/AddHeaderFooter.h b/Arduino/CanGrow/include/Webserver/Common.h
similarity index 95%
rename from Arduino/CanGrow/include/Webserver/AddHeaderFooter.h
rename to Arduino/CanGrow/include/Webserver/Common.h
index 4ab116a..a8ca683 100644
--- a/Arduino/CanGrow/include/Webserver/AddHeaderFooter.h
+++ b/Arduino/CanGrow/include/Webserver/Common.h
@@ -1,6 +1,6 @@
/*
*
- * include/Webserver/AddHeaderFooter.h - header file with functions to add
+ * include/Webserver/Common.h - header file with common webserver functions
* HTML header or footer to a String()
*
*
@@ -28,6 +28,7 @@
*
*/
+#include "Common_HTML.h"
bool TestHeaderFooter(const String& var) {
#ifdef DEBUG
diff --git a/Arduino/CanGrow/include/Webserver/Common_HTML.h b/Arduino/CanGrow/include/Webserver/Common_HTML.h
new file mode 100644
index 0000000..64f6aaf
--- /dev/null
+++ b/Arduino/CanGrow/include/Webserver/Common_HTML.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * include/Webserver/Common_HTML.h - header file with common HTML snippets
+ * HTML header or footer to a String()
+ *
+ *
+ * MIT License
+ *
+ * Copyright (c) 2024 DeltaLima
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+
+
+const char Common_HTML_SAVE_MSG[] PROGMEM = R"EOF(
+