mirror of
https://github.com/wled/WLED.git
synced 2025-07-13 13:56:35 +00:00
Tweaks in OTA UI
- added OTA section toggle - added ignore upload - fix for missing "NoXXX" ID - rely on 404 for /dmxmap
This commit is contained in:
parent
7973fd84f1
commit
796494e925
@ -13,7 +13,7 @@ function isN(n) { return !isNaN(parseFloat(n)) && isFinite(n); } // isNumber
|
||||
// https://stackoverflow.com/questions/3885817/how-do-i-check-that-a-number-is-float-or-integer
|
||||
function isF(n) { return n === +n && n !== (n|0); } // isFloat
|
||||
function isI(n) { return n === +n && n === (n|0); } // isInteger
|
||||
function toggle(el) { gId(el).classList.toggle("hide"); gId('No'+el).classList.toggle("hide"); }
|
||||
function toggle(el) { gId(el).classList.toggle("hide"); let n = gId('No'+el); if (n) n.classList.toggle("hide"); }
|
||||
function tooltip(cont=null) {
|
||||
d.querySelectorAll((cont?cont+" ":"")+"[title]").forEach((element)=>{
|
||||
element.addEventListener("pointerover", ()=>{
|
||||
|
@ -53,13 +53,13 @@
|
||||
Factory reset: <input type="checkbox" name="RS"><br>
|
||||
All settings and presets will be erased.<br><br>
|
||||
<div class="warn">⚠ Unencrypted transmission. An attacker on the same network can intercept form data!</div>
|
||||
<hr>
|
||||
<span id="OTA"><hr>
|
||||
<h3>Software Update</h3>
|
||||
<button type="button" onclick="U()">Manual OTA Update</button><br>
|
||||
<div id="aOTA">Enable ArduinoOTA: <input type="checkbox" name="AO"></div>
|
||||
Only allow update from same network/WiFi: <input type="checkbox" name="SU"><br>
|
||||
<i class="warn">⚠ If you are using multiple VLANs (i.e. IoT or guest network) either set PIN or disable this option.<br>
|
||||
Disabling this option will make your device less secure.</i><br>
|
||||
Disabling this option will make your device less secure.</i><br></span>
|
||||
<hr id="backup">
|
||||
<h3>Backup & Restore</h3>
|
||||
<div class="warn">⚠ Restoring presets/configuration will OVERWRITE your current presets/configuration.<br>
|
||||
|
@ -454,16 +454,12 @@ void initServer()
|
||||
serveMessage(request, 501, FPSTR(s_notimplemented), F("This build does not support OTA update."), 254);
|
||||
};
|
||||
server.on(_update, HTTP_GET, notSupported);
|
||||
server.on(_update, HTTP_POST, notSupported);
|
||||
server.on(_update, HTTP_POST, notSupported, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool isFinal){});
|
||||
#endif
|
||||
|
||||
#ifdef WLED_ENABLE_DMX
|
||||
server.on(F("/dmxmap"), HTTP_GET, [](AsyncWebServerRequest *request){
|
||||
request->send_P(200, FPSTR(CONTENT_TYPE_HTML), PAGE_dmxmap , dmxProcessor);
|
||||
});
|
||||
#else
|
||||
server.on(F("/dmxmap"), HTTP_GET, [](AsyncWebServerRequest *request){
|
||||
serveMessage(request, 501, FPSTR(s_notimplemented), F("DMX support is not enabled in this build."), 254);
|
||||
request->send_P(200, FPSTR(CONTENT_TYPE_HTML), PAGE_dmxmap, dmxProcessor);
|
||||
});
|
||||
#endif
|
||||
|
||||
|
@ -596,8 +596,11 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
||||
snprintf_P(tmp_buf,sizeof(tmp_buf),PSTR("WLED %s (build %d)"),versionString,VERSION);
|
||||
printSetClassElementHTML(settingsScript,PSTR("sip"),0,tmp_buf);
|
||||
settingsScript.printf_P(PSTR("sd=\"%s\";"), serverDescription);
|
||||
#ifndef WLED_ENABLE_AOTA
|
||||
//hide settings if not compiled
|
||||
#ifdef WLED_DISABLE_OTA
|
||||
settingsScript.print(F("toggle('OTA');")); // hide update section
|
||||
#endif
|
||||
#ifndef WLED_ENABLE_AOTA
|
||||
settingsScript.print(F("toggle('aOTA');")); // hide ArduinoOTA checkbox
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user