diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index 6070cad7..9019cf37 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -82,9 +82,6 @@ extern const uint8_t SCRIPT_JS_GZ_END[] asm("_binary_data_script_js_gz_end"); HTTPUpload* upload; -// const char HTTP_MENU_BUTTON[] PROGMEM = -// "
"; - const char MAIN_MENU_BUTTON[] PROGMEM = "" D_HTTP_MAIN_MENU ""; const char HTTP_DOCTYPE[] PROGMEM = " // String lcdFirmwareUrl = "http://haswitchplate.com/update/HASwitchPlate.tft"; //////////////////////////////////////////////////////////////////////////////////////////////////// -String getOption(int value, String label, int current_value) +String getOption(int value, String label, int current_value = INT_MIN) { char buffer[128]; snprintf_P(buffer, sizeof(buffer), PSTR(""), value, @@ -250,15 +247,9 @@ static void webSendHeader(const char* nodename, uint32_t httpdatalength, uint8_t } #if defined(STM32F4xx) - // webServer.sendContent(HTTP_SCRIPT); // 131 - // webServer.sendContent(HTTP_STYLE); // 487 - // webServer.sendContent(HASP_STYLE); // 145 webServer.sendContent(HTTP_HEADER_END); // 80 #else - // webServer.sendContent_P(HTTP_SCRIPT); // 131 - // webServer.sendContent_P(HTTP_STYLE); // 487 - // webServer.sendContent_P(HASP_STYLE); // 145 - webServer.sendContent_P(HTTP_HEADER_END); // 80 + webServer.sendContent_P(HTTP_HEADER_END); // 80 #endif } @@ -488,7 +479,7 @@ static void webHandleApiConfig() return; } - DynamicJsonDocument doc(800); + DynamicJsonDocument doc(1024); JsonObject settings; String contentType = getContentType(F(".json")); String endpoint((char*)0); @@ -786,7 +777,6 @@ static void webHandleFirmwareUpload() #if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0 static int handleFileRead(String path) { - // if(!httpIsAuthenticated(F("fileread"))) return false; if(!httpIsAuthenticated()) return false; path = webServer.urlDecode(path).substring(0, 31); @@ -896,7 +886,6 @@ static void handleFileUpload() LOG_ERROR(TAG_HTTP, F("Filename %s is too long"), filename.c_str()); } } else if(upload->status == UPLOAD_FILE_WRITE) { - // DBG_OUTPUT_PORT.print("handleFileUpload Data: "); debugPrintln(upload.currentSize); if(fsUploadFile) { if(fsUploadFile.write(upload->buf, upload->currentSize) != upload->currentSize) { LOG_ERROR(TAG_HTTP, F("Failed to write received data to file")); @@ -916,8 +905,6 @@ static void handleFileUpload() webServer.send_P(400, PSTR("text/plain"), "Bad Request"); } haspProgressVal(255); - - // httpReconnect(); } } @@ -941,7 +928,6 @@ static void handleFileDelete() } HASP_FS.remove(path); webServer.send_P(200, mimetype, PSTR("")); - // path.clear(); } static void handleFileCreate() @@ -1156,7 +1142,6 @@ static void webHandleMqttConfig() httpMessage += F(""); // Submit & End Form @@ -1179,9 +1164,6 @@ static void webHandleGuiConfig() if(!httpIsAuthenticated(F("config/gui"))) return; { // Send Content - StaticJsonDocument<256> settings; - guiGetConfig(settings.to