conflog 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <html><head>
  2. <meta charset='utf-8'><meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>
  3. <link rel='stylesheet' href='style.css'>
  4. <title>WiFiThermostat - WTherm-T5WZ</title>
  5. <script>
  6. function g(i) { return document.getElementById(i) };
  7. function sp(i){g(i).type=(g(i).type==='text'?'password':'text');}
  8. var xhttp, reqTime, reqFin;
  9. function selectElement(el, val) {
  10. el.value = val;
  11. }
  12. function transmit(f) {
  13. if (!xhttp) {
  14. reqTime = 0;
  15. reqFin = false;
  16. xhttp = new XMLHttpRequest();
  17. xhttp.timeout = 1000;
  18. xhttp.overrideMimeType('application/json');
  19. xhttp.open('POST', 'confDataLog');
  20. xhttp.send(f ? (new FormData(f)) : '');
  21. xhttp.onreadystatechange = function () {
  22. if (xhttp.readyState === XMLHttpRequest.DONE && xhttp.status === 200) {
  23. var data = JSON.parse(xhttp.responseText);
  24. selectElement(g('logLevSer'), data.logLevSer);
  25. selectElement(g('logLevWeb'), data.logLevWeb);
  26. selectElement(g('logLevMqtt'), data.logLevMqtt);
  27. xhttp = null;
  28. reqFin = true;
  29. }
  30. else {
  31. if(!reqFin && reqTime > 10) {
  32. xhttp = null;
  33. reqFin = true;
  34. }
  35. }
  36. }
  37. }
  38. return false;
  39. }
  40. function saveConf() {
  41. g('frmConf').submit();
  42. }
  43. function init() {
  44. transmit();
  45. }
  46. setInterval(function () { ++reqTime; }, 1000);
  47. </script>
  48. </head>
  49. <body onload='init()'>
  50. <div id='main'>
  51. <div id='head'>WiFiThermostat - WTherm-T5WZ
  52. </div><hr>
  53. <div></div>
  54. <p><b>Configuration - Logging</b></p>
  55. <div class='config'>
  56. <form id='frmConf' action='setConfLog' method='POST'>
  57. <fieldset>
  58. <legend>Log Levels</legend>
  59. <p><b>Serial</b><br>
  60. <select name='logLevSer' id='logLevSer'>
  61. <option value="0">Off</option>
  62. <option value="1">Error</option>
  63. <option value="2">Warn</option>
  64. <option value="3">Info</option>
  65. <option value="4">Debug</option>
  66. <option value="5">Verbose</option>
  67. </select></p>
  68. <p><b>Web-Console</b><br>
  69. <select name='logLevWeb' id='logLevWeb'>
  70. <option value="0">Off</option>
  71. <option value="1">Error</option>
  72. <option value="2">Warn</option>
  73. <option value="3">Info</option>
  74. <option value="4">Debug</option>
  75. <option value="5">Verbose</option>
  76. </select></p>
  77. <p><b>MQTT</b><br>
  78. <select name='logLevMqtt' id='logLevMqtt'>
  79. <option value="0">Off</option>
  80. <option value="1">Error</option>
  81. <option value="2">Warn</option>
  82. <option value="3">Info</option>
  83. <option value="4">Debug</option>
  84. <option value="5">Verbose</option>
  85. </select></p>
  86. <br>
  87. </fieldset>
  88. </form>
  89. <div></div>
  90. <table style='width:100%'>
  91. <td style='width:50%'><button onclick='location="conf";' class='bgrey'>Cancel</button></td>
  92. <td style='width:50%'><button onclick='return saveConf()' class='bred'>Save</button></td>
  93. </tr></table>
  94. <div></div>
  95. </div>
  96. <div style='text-align:right;font-size:0.7em;color:#AAA;'><hr/><a href='https://git.flokra.at/flo/WiFiThermostat' target='_blank' style='color:#AAA;'>WiFiThermostat</a> v0.6.0 by <a href='https://www.flokra.at/' target='_blank' style='color:#AAA;'>FloKra</a></div>
  97. </div></body></html>