diff --git a/src/hasp_http.cpp b/src/hasp_http.cpp index bfd23808..fc77fb3e 100644 --- a/src/hasp_http.cpp +++ b/src/hasp_http.cpp @@ -3,11 +3,13 @@ #include "ArduinoJson.h" #include "hasp_log.h" +#include "hasp_gui.h" #include "hasp_debug.h" #include "hasp_http.h" #include "hasp_mqtt.h" #include "hasp_wifi.h" #include "hasp_config.h" +#include "hasp_dispatch.h" #include "hasp.h" #if defined(ARDUINO_ARCH_ESP32) @@ -248,13 +250,9 @@ void httpHandleReboot() webSendPage(nodename, httpMessage.length(), true); webServer.sendContent(httpMessage); // len webServer.sendContent_P(HTTP_END); // 20 - delay(500); - debugPrintln(PSTR("HTTP: Reboot device")); - // haspProcessAttribute(F("p[0].b[1].txt"), F("\"Rebooting...\"")); - - delay(500); - haspReset(true); + delay(200); + dispatchCommand(F("reboot")); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -677,7 +675,7 @@ void webHandleConfig() F("
"); httpMessage += - F(""); + F(""); httpMessage += F(""); @@ -741,6 +739,35 @@ void webHandleMqttConfig() } #endif +//////////////////////////////////////////////////////////////////////////////////////////////////// +void webHandleGuiConfig() +{ // http://plate01/config/wifi + if(!httpIsAuthenticated(F("/config/gui"))) return; + + DynamicJsonDocument settings(256); + // guiGetConfig(settings.to