123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- /* clang-format off */
- //static const char html_confadd_script[] PROGMEM = R"=====(
- //<script>
- // function g(i) { return document.getElementById(i) };
- // function sp(i){g(i).type=(g(i).type==='text'?'password':'text');}
- // var xhttp, reqTime, reqFin;
- // function setCbx(el, da) {
- // if(el !== null) {
- // if(da == '1') {
- // el.checked = true;
- // el.style.visibility = 'visible';
- // }
- // else {
- // el.checked = false;
- // el.style.visibility = 'visible';
- // }
- // }
- // }
- // function updCbxVal(el) {
- // if(el !== null) {
- // if (el.checked) el.value = '1';
- // else {
- // el.checked = true;
- // el.value = '0';
- // el.style.visibility = 'hidden';
- // }
- // }
- // }
- static const char html_confadd_script[] PROGMEM = R"=====(
- function transmit(f) {
- if (!xhttp) {
- reqTime = 0;
- reqFin = false;
- xhttp = new XMLHttpRequest();
- xhttp.timeout = 1000;
- xhttp.overrideMimeType('application/json');
- xhttp.open('POST', 'confDataAdd');
- xhttp.send(f ? (new FormData(f)) : '');
- xhttp.onreadystatechange = function () {
- if (xhttp.readyState === XMLHttpRequest.DONE && xhttp.status === 200) {
- var data = JSON.parse(xhttp.responseText);
- g('PIRTop').value = data.PIRTop;
- g('PIROnPld').value = data.PIROnPld;
- g('PIROffPld').value = data.PIROffPld;
- g('outTempTop').value = data.outTempTop;
- g('outHumTop').value = data.outHumTop;
- xhttp = null;
- reqFin = true;
- }
- else {
- if(!reqFin && reqTime > 10) {
- xhttp = null;
- reqFin = true;
- }
- }
- }
- }
- return false;
- }
- //transmit();
- function saveConf() {
- g('frmConf').submit();
- }
- function init() {
- transmit();
- }
- )====="; // html_confadd_script
- // setInterval(function () { ++reqTime; }, 1000);
- //</script>
- //)====="; // html_confadd_script
- static const char html_confadd_body[] PROGMEM = R"=====(
- <b>Konfiguration - Zusätzliche Funktionen</b>
- <div class='config'>
- <form id='frmConf' action='setConfAdd' method='POST'>
- <br>
- <fieldset>
- <legend>PIR Sensor</legend>
- <p><b>MQTT Publish Topic</b><br><input type='text' name='PIRTop' id='PIRTop'/></p>
- <p><b>MQTT ON Payload</b><br><input type='text' name='PIROnPld' id='PIROnPld'/></p>
- <p><b>MQTT OFF Payload</b><br><input type='text' name='PIROffPld' id='PIROffPld'/></p>
- </fieldset>
- <div></div><br>
- <fieldset>
- <legend>Aussentemperatur Temp/Hum via MQTT</legend>
- <p class='n'>Wird nur verwendet wenn nicht leer und sinnvolle Daten ankommen.</p>
- <p><b>A-Temp In-Topic</b><br><input type='text' name='outTempTop' id='outTempTop'/></p>
- <p><b>A-Hum In-Topic</b><br><input type='text' name='outHumTop' id='outHumTop'/><br>
- </fieldset>
- <br>
- </form>
- <div></div>
- <table style='width:100%'>
- <td style='width:50%'><button onclick='location="conf";' class='bgrey'>Abbrechen</button></td>
- <td style='width:50%'><button onclick='return saveConf()' class='bred'>Speichern</button></td>
- </tr></table>
- </div>
- )====="; // html_confadd_body
|