2019-11-27 22:28:13 +01:00
|
|
|
<!DOCTYPE html>
|
2020-12-23 21:43:30 +01:00
|
|
|
<html lang="en">
|
2019-11-27 22:28:13 +01:00
|
|
|
<head>
|
|
|
|
<meta name="viewport" content="width=500">
|
2020-05-17 21:39:57 +02:00
|
|
|
<meta charset="utf-8">
|
2019-11-27 22:28:13 +01:00
|
|
|
<title>Misc Settings</title>
|
|
|
|
<script>
|
2021-07-14 23:10:19 +02:00
|
|
|
var d = document;
|
2019-11-27 22:28:13 +01:00
|
|
|
function H()
|
|
|
|
{
|
|
|
|
window.open("https://github.com/Aircoookie/WLED/wiki/Settings#security-settings");
|
|
|
|
}
|
|
|
|
function B()
|
|
|
|
{
|
|
|
|
window.open("/settings","_self");
|
|
|
|
}
|
|
|
|
function U()
|
|
|
|
{
|
|
|
|
window.open("/update","_self");
|
|
|
|
}
|
2021-07-14 23:10:19 +02:00
|
|
|
function gId(s)
|
|
|
|
{
|
|
|
|
return d.getElementById(s);
|
|
|
|
}
|
|
|
|
function isObject(item) {
|
|
|
|
return (item && typeof item === 'object' && !Array.isArray(item));
|
|
|
|
}
|
|
|
|
var timeout;
|
|
|
|
function showToast(text, error = false)
|
|
|
|
{
|
|
|
|
var x = gId("toast");
|
|
|
|
x.innerHTML = text;
|
|
|
|
x.className = error ? "error":"show";
|
|
|
|
clearTimeout(timeout);
|
|
|
|
x.style.animation = 'none';
|
|
|
|
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
|
|
|
|
}
|
2021-07-15 09:24:10 +02:00
|
|
|
function uploadFile(fO,name) {
|
2021-07-14 23:10:19 +02:00
|
|
|
var req = new XMLHttpRequest();
|
|
|
|
req.addEventListener('load', function(){showToast(this.responseText)});
|
|
|
|
req.addEventListener('error', function(e){showToast(e.stack,true);});
|
|
|
|
req.open("POST", "/upload");
|
|
|
|
var formData = new FormData();
|
2021-07-15 09:24:10 +02:00
|
|
|
formData.append("data", fO.files[0], name);
|
2021-07-14 23:10:19 +02:00
|
|
|
req.send(formData);
|
2021-07-15 09:24:10 +02:00
|
|
|
fO.value = '';
|
2021-07-14 23:10:19 +02:00
|
|
|
return false;
|
|
|
|
}
|
2019-11-27 22:28:13 +01:00
|
|
|
function GetV()
|
|
|
|
{
|
|
|
|
//values injected by server while sending HTML
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
2020-06-10 12:45:44 +02:00
|
|
|
@import url("style.css");
|
2019-11-27 22:28:13 +01:00
|
|
|
</style>
|
2021-06-06 20:36:19 +02:00
|
|
|
<link href="/skin.css" rel="stylesheet">
|
2019-11-27 22:28:13 +01:00
|
|
|
</head>
|
|
|
|
<body onload="GetV()">
|
|
|
|
<form id="form_s" name="Sf" method="post">
|
2021-03-05 09:50:59 +01:00
|
|
|
<div class="toprow">
|
2019-11-27 22:28:13 +01:00
|
|
|
<div class="helpB"><button type="button" onclick="H()">?</button></div>
|
|
|
|
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button><hr>
|
2021-03-05 09:50:59 +01:00
|
|
|
</div>
|
2019-11-27 22:28:13 +01:00
|
|
|
<h2>Security & Update setup</h2>
|
|
|
|
Lock wireless (OTA) software update: <input type="checkbox" name="NO"><br>
|
|
|
|
Passphrase: <input type="password" name="OP" maxlength="32"><br>
|
|
|
|
To enable OTA, for security reasons you need to also enter the correct password!<br>
|
|
|
|
The password should be changed when OTA is enabled.<br>
|
|
|
|
<b>Disable OTA when not in use, otherwise an attacker can reflash device software!</b><br>
|
|
|
|
<i>Settings on this page are only changable if OTA lock is disabled!</i><br>
|
|
|
|
Deny access to WiFi settings if locked: <input type="checkbox" name="OW"><br><br>
|
|
|
|
Factory reset: <input type="checkbox" name="RS"><br>
|
2021-04-15 10:55:22 +02:00
|
|
|
All settings and presets will be erased.<br><br>
|
2019-11-27 22:28:13 +01:00
|
|
|
HTTP traffic is unencrypted. An attacker in the same network can intercept form data!
|
2021-07-14 23:10:19 +02:00
|
|
|
<hr>
|
2021-07-15 09:24:10 +02:00
|
|
|
<a class="btn" href="/presets.json?download" target="download-frame">Backup presets</a><br>
|
|
|
|
<div id="presets">Restore presets:<input type="file" name="data" accept=".json"> <input type="button" value="Upload" onclick="uploadFile(d.Sf.data,'/presets.json');"><br></div>
|
2021-07-15 18:38:42 +02:00
|
|
|
<a class="btn" href="/cfg.json?download" target="download-frame">Backup configuration</a><br>
|
|
|
|
<div id="presets">Restore configuration:<input type="file" name="data2" accept=".json"> <input type="button" value="Upload" onclick="uploadFile(d.Sf.data2,'/cfg.json');"><br></div>
|
2021-07-19 19:00:21 +02:00
|
|
|
<div style="color: #fa0;">WARNING!<br>Restoring presets/configuration will OVERWRITE current presets/configuration.<br>
|
2021-07-15 18:38:42 +02:00
|
|
|
Incorrect configuration may require factory reset or re-flashing of ESP.</div>
|
2021-07-14 23:10:19 +02:00
|
|
|
<hr>
|
2019-11-27 22:28:13 +01:00
|
|
|
<h3>Software Update</h3>
|
|
|
|
<button type="button" onclick="U()">Manual OTA Update</button><br>
|
|
|
|
Enable ArduinoOTA: <input type="checkbox" name="AO"><br>
|
2021-07-15 18:38:42 +02:00
|
|
|
<hr>
|
2019-11-27 22:28:13 +01:00
|
|
|
<h3>About</h3>
|
2020-06-08 19:59:40 +02:00
|
|
|
<a href="https://github.com/Aircoookie/WLED/" target="_blank">WLED</a> version ##VERSION##<!-- Autoreplaced from package.json --><br><br>
|
2021-01-05 21:35:07 +01:00
|
|
|
<a href="https://github.com/Aircoookie/WLED/wiki/Contributors-and-credits" target="_blank">Contributors, dependencies and special thanks</a><br>
|
2019-11-27 22:28:13 +01:00
|
|
|
A huge thank you to everyone who helped me create WLED!<br><br>
|
2021-01-05 21:35:07 +01:00
|
|
|
(c) 2016-2021 Christian Schwinne <br>
|
2020-11-10 13:30:42 +01:00
|
|
|
<i>Licensed under the <a href="https://github.com/Aircoookie/WLED/blob/master/LICENSE" target="_blank">MIT license</a></i><br><br>
|
2020-05-02 01:59:41 +02:00
|
|
|
Server message: <span class="sip"> Response error! </span><hr>
|
2021-07-14 23:10:19 +02:00
|
|
|
<div id="toast"></div>
|
2019-11-27 22:28:13 +01:00
|
|
|
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button>
|
|
|
|
</form>
|
2021-07-15 09:24:10 +02:00
|
|
|
<iframe name=download-frame style='display:none;'></iframe>
|
2019-11-27 22:28:13 +01:00
|
|
|
</body>
|
|
|
|
</html>
|