diff --git a/data/script.js b/data/script.js index ff8ba7d8..5cc11ab3 100644 --- a/data/script.js +++ b/data/script.js @@ -40,9 +40,8 @@ function loader(e, t, o) { }); } function fill() { - (data = JSON.parse(this.response)), - (form = document.forms.item(0)), - populate(form, data); + data = JSON.parse(this.response); + for (const form of document.forms) populate(form, data); } function filler(e, t) { window.addEventListener("load", function () { diff --git a/data/script.js.gz b/data/script.js.gz index 768c3cbe..cc985c52 100644 Binary files a/data/script.js.gz and b/data/script.js.gz differ diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index f554cdd6..f056db21 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -297,9 +297,6 @@ void debug_get_tag(uint8_t tag, char* buffer) case TAG_OTA: memcpy_P(buffer, PSTR("OTA "), 5); break; - case TAG_FWUP: - memcpy_P(buffer, PSTR("FWUP"), 5); - break; case TAG_LVGL: memcpy_P(buffer, PSTR("LVGL"), 5); diff --git a/src/hasp_debug.h b/src/hasp_debug.h index 68c6db96..f4a68901 100644 --- a/src/hasp_debug.h +++ b/src/hasp_debug.h @@ -182,8 +182,6 @@ enum { TAG_FILE = 31, TAG_GPIO = 40, - TAG_FWUP = 50, - TAG_ETH = 60, TAG_WIFI = 61, TAG_HTTP = 62, diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index d84021d6..6070cad7 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -90,12 +90,12 @@ const char MAIN_MENU_BUTTON[] PROGMEM = "" D_HTTP_MAIN_MENU ""; const char HTTP_DOCTYPE[] PROGMEM = ""; const char HTTP_META_GO_BACK[] PROGMEM = ""; +const char HTTP_STYLESHEET[] PROGMEM = ""; const char HTTP_HEADER[] PROGMEM = "%s"; -const char HTTP_HEADER_END[] PROGMEM = - "" - "
"; -const char HTTP_FOOTER[] PROGMEM = "

" D_MANUFACTURER " "; -const char HTTP_END[] PROGMEM = " " D_HTTP_FOOTER "
"; +const char HTTP_HEADER_END[] PROGMEM = "" + "
"; +const char HTTP_FOOTER[] PROGMEM = ""; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -218,7 +218,8 @@ static void webSendHeader(const char* nodename, uint32_t httpdatalength, uint8_t /* Calculate Content Length upfront */ uint32_t contentLength = strlen(haspDevice.get_version()); // version length contentLength += sizeof(HTTP_DOCTYPE) - 1; - contentLength += sizeof(HTTP_HEADER) - 1 - 2 + strlen(nodename); // -2 for %s + contentLength += sizeof(HTTP_HEADER) - 1 - 2 + strlen(nodename); // -2 for %s + contentLength += sizeof(HTTP_STYLESHEET) - 1 - 2 + strlen("vars"); // -2 for %s if(gohome > 0) { snprintf_P(buffer, sizeof(buffer), HTTP_META_GO_BACK, gohome); contentLength += strlen(buffer); // gohome @@ -241,6 +242,9 @@ static void webSendHeader(const char* nodename, uint32_t httpdatalength, uint8_t #endif webServer.sendContent(buffer); // gohome + snprintf_P(buffer, sizeof(buffer), HTTP_STYLESHEET, "vars"); + webServer.sendContent(buffer); // stylesheet + snprintf_P(buffer, sizeof(buffer), HTTP_HEADER, nodename); webServer.sendContent(buffer); // 17-2+len } @@ -1230,7 +1234,7 @@ static void webHandleGuiConfig() // Backlight Pin int8_t bcklpin = settings[FPSTR(FP_GUI_BACKLIGHTPIN)].as(); - httpMessage += F("
"); + httpMessage += F("
"); httpMessage += F("
"); + httpMessage += F("

Backlight Pin