diff --git a/.gitignore b/.gitignore index 4a2de0c9..acab9ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ bin/* data/* !data/edit.htm +!data/main.js !data/edit.htm.gz !data/openhasp.ttf !data/style.css diff --git a/data/edit.htm b/data/edit.htm index d28420dd..cd185e2c 100644 --- a/data/edit.htm +++ b/data/edit.htm @@ -1 +1,665 @@ -
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.
'); - ihtm("pkg","Based on the previous work of the following open source developers:
Copyright© 2019 Allen Derusha allen @derusha.orgMIT License
Copyright© 2021 LVGL KftMIT License
Copyright© 2020 lovyan03 (https://github.com/lovyan03) All rights reserved.FreeBSD License
Copyright© 2020 Bodmer (https://github.com/Bodmer) All rights reserved.FreeBSD License
Copyright© 2012 Adafruit Industries. All rights reservedBSD License
Copyright© 2014-2021 Benoit BLANCHONMIT License
Copyright© 2017,2018 Thijs Elenbaas, MrRobot62, rahuldeo2047, NOX73, dhylands, Josha blemasle, mfalkviddMIT License
Copyright© Project NayukiMIT License
Copyright© 2017 Renzo Mischianti www.mischianti.org All right reserved.MIT License
Copyright© 2018 Brian T. ParkMIT License
"); + ihtm("pkg","Based on the previous work of the following open source developers:
Copyright© 2019 Allen Derusha allen @derusha.orgMIT License
Copyright© 2021 LVGL KftMIT License
Copyright© 2020 lovyan03 (https://github.com/lovyan03) All rights reserved.FreeBSD License
Copyright© 2020 Bodmer (https://github.com/Bodmer) All rights reserved.FreeBSD License
Copyright© 2012 Adafruit Industries. All rights reservedBSD License
Copyright© 2014-2021 Benoit BLANCHONMIT License
Copyright© 2008-2015 Nicholas O'LearyMIT License
Copyright© 2017,2018 Thijs Elenbaas, MrRobot62, rahuldeo2047, NOX73, dhylands, Josha blemasle, mfalkviddMIT License
Copyright© Project NayukiMIT License
Copyright© 2017 Renzo Mischianti www.mischianti.org All right reserved.MIT License
Copyright© 2018 Brian T. ParkMIT License
"); } function handleSubmit(e) { e.preventDefault(); @@ -126,7 +126,7 @@ function populate(e, t, o) { window.addEventListener('load', (event) => { - console.log('The page has fully loaded'); + // console.log('The page has fully loaded'); forms(); info(); about(); diff --git a/data/static/edit.htm.gz b/data/static/edit.htm.gz index 5a6eae02..cbea9b3c 100644 Binary files a/data/static/edit.htm.gz and b/data/static/edit.htm.gz differ diff --git a/data/static/en.json.gz b/data/static/en.json.gz index 9278e158..4c8f258b 100644 Binary files a/data/static/en.json.gz and b/data/static/en.json.gz differ diff --git a/data/static/fr.json.gz b/data/static/fr.json.gz new file mode 100644 index 00000000..84db85ac Binary files /dev/null and b/data/static/fr.json.gz differ diff --git a/data/static/hasp.htm.gz b/data/static/hasp.htm.gz index 7fb75272..391bb860 100644 Binary files a/data/static/hasp.htm.gz and b/data/static/hasp.htm.gz differ diff --git a/data/static/logo.svg b/data/static/logo.svg deleted file mode 100644 index c76e44b3..00000000 --- a/data/static/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/data/static/main.js.gz b/data/static/main.js.gz index 77268994..d5feb9cf 100644 Binary files a/data/static/main.js.gz and b/data/static/main.js.gz differ diff --git a/data/static/nl.json.gz b/data/static/nl.json.gz new file mode 100644 index 00000000..744beee7 Binary files /dev/null and b/data/static/nl.json.gz differ diff --git a/data/static/script.js.gz b/data/static/script.js.gz index 3e7738bf..3fc28f3e 100644 Binary files a/data/static/script.js.gz and b/data/static/script.js.gz differ diff --git a/data/static/style.css.gz b/data/static/style.css.gz index 8466e9d6..d7ed0ac6 100644 Binary files a/data/static/style.css.gz and b/data/static/style.css.gz differ diff --git a/data/style.css b/data/style.css index df574e3a..eea45e82 100644 --- a/data/style.css +++ b/data/style.css @@ -8,9 +8,35 @@ --cog: url('data:image/svg+xml,'); --star: url('data:image/svg+xml,'); --trash: url('data:image/svg+xml,'); - --download: url('data:image/svg+xml,') + --download: url('data:image/svg+xml,'); + --file: url('data:image/svg+xml,'); + --dir: url('data:image/svg+xml,'); + --diropen: url('data:image/svg+xml,'); + --html: url('data:image/svg+xml,'); + --image: url('data:image/svg+xml,'); + --zip: url('data:image/svg+xml,'); + --cmd: url('data:image/svg+xml,'); + --css: url('data:image/svg+xml,'); + --eye: url('data:image/svg+xml,'); + --json: url('data:image/svg+xml,'); } +.fn:hover { + text-decoration: underline; +} +.fi { + display: inline-block; + vertical-align: middle; + width: 1.1rem; + height: 1.25rem; + mask-size: auto; + mask-repeat: no-repeat; + mask-position: center; + -webkit-mask-size: auto; + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center; + background-color: var(--txt); +} .fa { display: block; text-indent: -9999px; @@ -37,28 +63,17 @@ .fa-shot { mask-image: var(--shot); -webkit-mask-image: var(--shot)} .fa-star { mask-image: var(--star); -webkit-mask-image: var(--star)} .fa-trash { mask-image: var(--trash); -webkit-mask-image: var(--trask)} - -#ctx { - display: none; - top: 10px; - left: 50px; - position: absolute; - background: #fff; - z-index: 10; - padding: 0.75rem; - border-radius: 0.5rem; - box-shadow: 0 0.5rem 0.75rem rgba(0,0,0,0.25); -} -#ctx > ul { - padding-left: 0px; -} -#ctx > ul > li, -.sub_div > ul > li { - cursor: pointer; -} -#ctx > ul > li:hover { - background: #ccc; -} +.fa-file { mask-image: var(--file); -webkit-mask-image: var(--file)} +.fa-dir { mask-image: var(--dir); -webkit-mask-image: var(--dir)} +.fa-diropen { mask-image: var(--diropen); -webkit-mask-image: var(--diropen)} +.fa-eye { mask-image: var(--eye); -webkit-mask-image: var(--eye)} +.fa-zip { mask-image: var(--zip); -webkit-mask-image: var(--zip)} +.fa-css { mask-image: var(--css); -webkit-mask-image: var(--css)} +.fa-cmd { mask-image: var(--cmd); -webkit-mask-image: var(--cmd)} +.fa-json { mask-image: var(--json); -webkit-mask-image: var(--json)} +.fa-jsonl { mask-image: var(--json); -webkit-mask-image: var(--json)} +.fa-image { mask-image: var(--image); -webkit-mask-image: var(--image)} +.fa-html { mask-image: var(--html); -webkit-mask-image: var(--html)} .nav-list { font-size: var(--fs-nav); @@ -114,7 +129,7 @@ margin: 0px; padding: 0px; } -P { +p { margin: 1em 0px; } @@ -156,30 +171,27 @@ button, .warning{ color: #9F6000; background-color: #FEEFB3 } .error { color: #D8000C; background-color: #FFD2D2 } - -/* Navigation bar */ - -#filebrowser { - display: none -} +.left { float: left } +.right { float: right } +.bold { font-weight: bold } /* Main Page */ #doc { text-align: left; margin: 0 auto; - display: inline-block; + /* display: inline-block; + display: table; */ color: var(--txt); width: 80%; min-width: 300px; max-width: 600px; - display: table } #doc>a, .dist>a, #doc button, #doc input[type=submit] { - // padding: 12px; + /* padding: 12px; */ height: 3rem; border: 1px solid var(--btnbrd); border-radius: .6rem; @@ -245,7 +257,7 @@ button, padding-top: 0 } #doc th { - padding-top: .5em + padding-top: .5rem } #doc input, @@ -262,7 +274,7 @@ button, background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .8rem center; - background-size: 1em + background-size: 1rem } #doc label { @@ -271,34 +283,30 @@ button, display: inline-block } +#bmp { + max-width: 100%; + height: auto; +} + .required { background-image: var(--star); background-position: right; background-repeat: no-repeat; - background-size: 1.5em 1.5em; + background-size: 1.5rem 1.5rem; } .icon { - background-size: 1.05em 1.05em; + background-size: 1.25rem 1.25rem; background-position: left; background-repeat: no-repeat; - width: 1.5em; + width: 1.5rem; display: inline-block; text-decoration: none } -.icon:before { - content: "\0000a0" -} -.edit { - background-image: var(--browse); -} -.trash { - background-image: var(--trash); -} -.download { - background-image: var(--download); -} +.icon:before{content: "\0000a0"} +.edit{background-image: var(--browse)} +.trash{background-image: var(--trash)} /* Forms */ .container { @@ -336,7 +344,7 @@ button, } .row { - // font-size: .833rem; + /* font-size: .833rem; */ margin: 5px } @@ -346,15 +354,15 @@ button, } .col-25 { - // float: left; - // width: 25%; + /* float: left; + width: 25%; */ text-align: left; } -.col-75 { - // float: left; - // width: 75% -} +/* .col-75 { + float: left; + width: 75% +} */ #doc label, #doc legend { @@ -363,6 +371,9 @@ button, #doc fieldset { display: contents } +[v-cloak] > * { display:none } +/* [v-cloak]::before { content: "Loading…"; margin: auto; } */ + @media screen and (min-width:800px) { .row { @@ -405,13 +416,13 @@ button, } */ -/* Page Footer */ +/* ********** Page Footer ********** */ .foot { background-color: transparent !important; all: revert; float: right; margin: 0; - font-size: .6em + font-size: .6rem } a.foot:link, a.foot:visited { @@ -421,19 +432,21 @@ a.foot:visited { clear: both } -/* File Editor */ +/* ********** File Editor ********** */ .container__editor { - display: none; + /* display: none; */ + display: flex; /* Misc */ border: 0; width: 100vw; height: 100vh; - background-color: burlywood; + background-color: var(--bg); } .container__left { /* Initially, the left takes 3/4 width */ - width: clamp(10rem, 15vw, 20rem); + width: 10rem; + min-width: 6rem; max-width: 20rem; /* Misc */ @@ -467,18 +480,14 @@ a.foot:visited { align-items: center; display: flex; justify-content: center; - background-color: brown; + background-color: var(--grpbg) } .toolbar { - /* Take the remaining width */ - height: 3rem; - background-color: gray; - - /* Misc */ - align-items: center; - display: flex; - justify-content: center; + text-align: center; width: 100%; + padding: 0.5rem; + color: var(--btnfg); + background-color: var(--toolbg) } .container__bottom { /* Take the remaining width */ @@ -495,4 +504,63 @@ a.foot:visited { } #sizeList { width: 4rem; -} \ No newline at end of file +} +#ctx { + display: none; + top: 10px; + left: 50px; + position: absolute; + background: #fff; + z-index: 10; + padding: 0.75rem; + border-radius: 0.5rem; + box-shadow: 0 0.5rem 0.75rem rgba(0,0,0,0.25); +} +#ctx > ul { + padding-left: 0px; +} +#ctx > ul > li, +.sub_div > ul > li { + cursor: pointer; + white-space: nowrap +} +#ctx > ul > li:hover { + background: #ccc; +} +#fontsize, #page { + width: 3rem +} +#preview { + background-color: #888; + padding: 5px; + overflow: scroll; +} +#preview > img { + max-width:100%; + max-height:100%; + height: 100%; + margin: auto; + display: block +} +#download-frame, +#preview { + display:none; +} +#tree { + width: 100%; + line-height: 1.3rem; + font-size: 0.95rem; + background-color: var(--treebg) +} +.download{background-image: var(--download)} +.eye{background-image: var(--eye)} +.file{background-image: var(--file)} +.zip{background-image: var(--zip)} +.css{background-image: var(--css)} +.cmd{background-image: var(--cmd)} +.json{background-image: var(--json)} +.jsonl{background-image: var(--json)} +.image{background-image: var(--image)} +.html{background-image: var(--html)} +.dir{background-image: var(--dir)} +.diropen{background-image: var(--diropen)} diff --git a/src/hasp_config.h b/src/hasp_config.h index 5b4e0d72..00d24d58 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -36,40 +36,47 @@ void configSetConfig(JsonObject& settings); void configGetConfig(JsonDocument& settings); /* json keys used in the configfile */ -const char FP_CONFIG_STARTPAGE[] PROGMEM = "startpage"; -const char FP_CONFIG_STARTDIM[] PROGMEM = "startdim"; -const char FP_CONFIG_THEME[] PROGMEM = "theme"; -const char FP_CONFIG_HUE[] PROGMEM = "hue"; -const char FP_CONFIG_ZIFONT[] PROGMEM = "font"; -const char FP_CONFIG_PAGES[] PROGMEM = "pages"; -const char FP_CONFIG_COLOR1[] PROGMEM = "color1"; -const char FP_CONFIG_COLOR2[] PROGMEM = "color2"; -const char FP_CONFIG_ENABLE[] PROGMEM = "enable"; -const char FP_CONFIG_HOST[] PROGMEM = "host"; -const char FP_CONFIG_PORT[] PROGMEM = "port"; -const char FP_CONFIG_PASV[] PROGMEM = "pasv"; -const char FP_CONFIG_NAME[] PROGMEM = "name"; -const char FP_CONFIG_USER[] PROGMEM = "user"; -const char FP_CONFIG_PASS[] PROGMEM = "pass"; -const char FP_CONFIG_SSID[] PROGMEM = "ssid"; -const char FP_CONFIG_NODE[] PROGMEM = "node"; -const char FP_CONFIG_GROUP[] PROGMEM = "group"; -const char FP_CONFIG_BROADCAST[] PROGMEM = "group"; -const char FP_CONFIG_BAUD[] PROGMEM = "baud"; -const char FP_CONFIG_LOG[] PROGMEM = "log"; -const char FP_CONFIG_PROTOCOL[] PROGMEM = "proto"; -const char FP_GUI_ROTATION[] PROGMEM = "rotate"; -const char FP_GUI_INVERT[] PROGMEM = "invert"; -const char FP_GUI_TICKPERIOD[] PROGMEM = "tick"; -const char FP_GUI_IDLEPERIOD1[] PROGMEM = "idle1"; -const char FP_GUI_IDLEPERIOD2[] PROGMEM = "idle2"; -const char FP_GUI_CALIBRATION[] PROGMEM = "calibration"; -const char FP_GUI_BACKLIGHTPIN[] PROGMEM = "bckl"; -const char FP_GUI_BACKLIGHTINVERT[] PROGMEM = "bcklinv"; -const char FP_GUI_POINTER[] PROGMEM = "cursor"; -const char FP_DEBUG_TELEPERIOD[] PROGMEM = "tele"; -const char FP_DEBUG_ANSI[] PROGMEM = "ansi"; -const char FP_GPIO_CONFIG[] PROGMEM = "config"; +const char FP_CONFIG_STARTPAGE[] PROGMEM = "startpage"; +const char FP_CONFIG_STARTDIM[] PROGMEM = "startdim"; +const char FP_CONFIG_THEME[] PROGMEM = "theme"; +const char FP_CONFIG_HUE[] PROGMEM = "hue"; +const char FP_CONFIG_ZIFONT[] PROGMEM = "font"; +const char FP_CONFIG_PAGES[] PROGMEM = "pages"; +const char FP_CONFIG_COLOR1[] PROGMEM = "color1"; +const char FP_CONFIG_COLOR2[] PROGMEM = "color2"; +const char FP_CONFIG_ENABLE[] PROGMEM = "enable"; +const char FP_CONFIG_HOST[] PROGMEM = "host"; +const char FP_CONFIG_PORT[] PROGMEM = "port"; +const char FP_CONFIG_PASV[] PROGMEM = "pasv"; +const char FP_CONFIG_NAME[] PROGMEM = "name"; +const char FP_CONFIG_USER[] PROGMEM = "user"; +const char FP_CONFIG_PASS[] PROGMEM = "pass"; +const char FP_CONFIG_SSID[] PROGMEM = "ssid"; +const char FP_CONFIG_NODE[] PROGMEM = "node"; +const char FP_CONFIG_NODE_TOPIC[] PROGMEM = "node_t"; +const char FP_CONFIG_HASS[] PROGMEM = "hass"; +const char FP_CONFIG_HASS_TOPIC[] PROGMEM = "hass_t"; +const char FP_CONFIG_GROUP[] PROGMEM = "group"; +const char FP_CONFIG_GROUP_TOPIC[] PROGMEM = "group_t"; +const char FP_CONFIG_BROADCAST[] PROGMEM = "broadcast"; +const char FP_CONFIG_BROADCAST_TOPIC[] PROGMEM = "broadcast_t"; +const char FP_CONFIG_BAUD[] PROGMEM = "baud"; +const char FP_CONFIG_LOG[] PROGMEM = "log"; +const char FP_CONFIG_PROTOCOL[] PROGMEM = "proto"; +const char FP_GUI_ROTATION[] PROGMEM = "rotate"; +const char FP_GUI_INVERT[] PROGMEM = "invert"; +const char FP_GUI_TICKPERIOD[] PROGMEM = "tick"; +const char FP_GUI_IDLEPERIOD1[] PROGMEM = "idle1"; +const char FP_GUI_IDLEPERIOD2[] PROGMEM = "idle2"; +const char FP_GUI_CALIBRATION[] PROGMEM = "calibration"; +const char FP_GUI_BACKLIGHTPIN[] PROGMEM = "bckl"; +const char FP_GUI_BACKLIGHTINVERT[] PROGMEM = "bcklinv"; +const char FP_GUI_POINTER[] PROGMEM = "cursor"; +const char FP_GUI_LONG_TIME[] PROGMEM = "long"; +const char FP_GUI_REPEAT_TIME[] PROGMEM = "repeat"; +const char FP_DEBUG_TELEPERIOD[] PROGMEM = "tele"; +const char FP_DEBUG_ANSI[] PROGMEM = "ansi"; +const char FP_GPIO_CONFIG[] PROGMEM = "config"; const char FP_HASP_CONFIG_FILE[] PROGMEM = "/config.json"; diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index 6f44023e..37047f23 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -100,33 +100,39 @@ HTTPUpload* upload; 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_STYLESHEET[] PROGMEM = ""; const char HTTP_HEADER[] PROGMEM = "" D_HTTP_CONFIG_CHANGED "
"); - } - - httpMessage += F("" D_HTTP_HASP_DESIGN ""); - httpMessage += F("" D_HTTP_SCREENSHOT ""); - httpMessage += F("" D_HTTP_INFORMATION ""); - httpMessage += F("" D_HTTP_CONFIGURATION ""); - httpMessage += F("" D_HTTP_FIRMWARE_UPGRADE ""); - -#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0 -#ifdef ARDUINO_ARCH_ESP32 - bool flashfile = true; -#else - bool flashfile = false; -#endif - if(flashfile || HASP_FS.exists(F("/edit.htm.gz")) || HASP_FS.exists(F("/edit.htm"))) { - httpMessage += F("" D_HTTP_FILE_BROWSER ""); - } -#endif - - httpMessage += F("" D_HTTP_REBOOT ""); - - webSendHtmlHeader(haspDevice.get_hostname(), httpMessage.length(), 0); - webServer.sendContent(httpMessage); + html[min(i++, len)] = "" D_HTTP_CONFIG_CHANGED "
)"; } - webSendFooter(); + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; +#ifdef ARDUINO_ARCH_ESP32 + html[min(i++, len)] = R"()"; +#endif + html[min(i++, len)] = R"()"; + http_send_content(html, min(i, len)); } //////////////////////////////////////////////////////////////////////////////////////////////////// -static void httpHandleReboot() +static void http_handle_reboot() { // http://plate01/reboot if(!http_is_authenticated(F("reboot"))) return; - { // Send Content - String httpMessage((char*)0); - httpMessage.reserve(HTTP_PAGE_SIZE); - httpMessage += F("
+{{model.y}} {{model.a}}
+
+
Copyright 2019-2023 Francis Van RoieMIT License
+ + + + +openHASP | +|
---|---|
{{ item }} | Device Memory | +
{{ item }} | LVGL Memory | +
{{ item }} | MQTT | +
{{ item }} | Wifi | +
{{ item }} | Module | +
{{ item }} |
" D_HTTP_CONFIG_CHANGED "
"); - } + html[min(i++, len)] = ")" D_HTTP_CONFIG_CHANGED "
"; + } #if HASP_USE_WIFI > 0 - httpMessage += F("" D_HTTP_WIFI_SETTINGS ""); + html[min(i++, len)] = R"()"; #endif #if HASP_USE_MQTT > 0 - httpMessage += F("" D_HTTP_MQTT_SETTINGS ""); + html[min(i++, len)] = R"()"; #endif - httpMessage += F("" D_HTTP_HTTP_SETTINGS ""); + html[min(i++, len)] = R"()"; #if HASP_USE_FTP > 0 - httpMessage += F("" D_HTTP_FTP_SETTINGS ""); + html[min(i++, len)] = R"()"; #endif - httpMessage += F("" D_HTTP_GUI_SETTINGS ""); - + html[min(i++, len)] = R"()"; #if HASP_USE_GPIO > 0 - httpMessage += F("" D_HTTP_GPIO_SETTINGS ""); + html[min(i++, len)] = R"()"; #endif - - httpMessage += F("" D_HTTP_DEBUG_SETTINGS ""); - httpMessage += F("" D_HTTP_FACTORY_RESET ""); - httpMessage += FPSTR(MAIN_MENU_BUTTON); - - webSendHtmlHeader(haspDevice.get_hostname(), httpMessage.length(), 0); - webServer.sendContent(httpMessage); - } - webSendFooter(); + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + html[min(i++, len)] = R"()"; + http_send_content(html, min(i, len)); } //////////////////////////////////////////////////////////////////////////////////////////////////// #if HASP_USE_MQTT > 0 -static void webHandleMqttConfig() +static void http_handle_mqtt() { // http://plate01/config/mqtt if(!http_is_authenticated(F("config/mqtt"))) return; - { // Send Content - StaticJsonDocument<256> settings; - mqttGetConfig(settings.to{{ config }}
/
Updating firmware from: )"; + html[min(i++, len)] = url.c_str(); + html[min(i++, len)] = R"(
Please wait...
)"; + html[min(i++, len)] = R"()"; + http_send_content(html, min(i, len)); - httpMessage += F("Updating firmware from: "); - httpMessage += url; - httpMessage += F("
Please wait...
"); - - httpMessage += FPSTR(MAIN_MENU_BUTTON); - - webSendHtmlHeader(haspDevice.get_hostname(), httpMessage.length(), 60); - webServer.sendContent(httpMessage); - } - - webSendFooter(); dispatch_web_update(NULL, url.c_str(), TAG_HTTP); - return; + } else { - // Send Firmware page - String httpMessage((char*)0); - httpMessage.reserve(HTTP_PAGE_SIZE); - httpMessage += F("