Browse Source

Fix relay status updates in web UI

fastled
Xose Pérez 7 years ago
parent
commit
6e35a218d9
4 changed files with 2413 additions and 2407 deletions
  1. BIN
      code/espurna/data/index.html.gz
  2. +2403
    -2402
      code/espurna/static/index.html.gz.h
  3. +7
    -2
      code/html/custom.js
  4. +3
    -3
      code/html/index.html

BIN
code/espurna/data/index.html.gz View File


+ 2403
- 2402
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 7
- 2
code/html/custom.js View File

@ -469,7 +469,7 @@ function initRelays(data) {
for (var i=0; i<data.length; i++) {
var line = $(template).clone();
$(".id", line).html(i);
$("input", line).attr("data", i).prop("checked", data[i]);
$("input", line).attr("data", i);
line.appendTo("#relays");
$(":checkbox", line).iphoneStyle({
onChange: doToggle,
@ -477,7 +477,7 @@ function initRelays(data) {
resizeHandle: true,
checkedLabel: 'ON',
uncheckedLabel: 'OFF'
}).iphoneStyle("refresh");
});
}
@ -817,6 +817,11 @@ function processData(data) {
if (key == "relayStatus") {
initRelays(data[key]);
for (var i in data[key]) {
$("input.relayStatus[data='" + i + "']")
.prop("checked", data[key][i])
.iphoneStyle("refresh");
}
return;
}


+ 3
- 3
code/html/index.html View File

@ -457,7 +457,7 @@
<div class="pure-g">
<label class="pure-u-1 pure-u-lg-1-4">HTTP API Key</label>
<input name="apiKey" class="pure-u-3-4 pure-u-lg-1-2" type="text" tabindex="14" />
<div class=" pure-u-1-4 pure-u-lg-1-4"><button class="pure-button button-apikey pure-u-23-24">Generate</button></div>
<div class=" pure-u-1-4 pure-u-lg-1-4"><button class="pure-button button-apikey pure-u-23-24">Auto</button></div>
<div class="pure-u-0 pure-u-lg-1-4"></div>
<div class="pure-u-1 pure-u-lg-3-4 hint">
This is the key you will have to pass with every HTTP request to the API, either to get or write values.
@ -915,8 +915,8 @@
<div class="pure-g">
<label class="pure-u-1 pure-u-lg-1-4">Network SSID</label>
<div class="pure-u-11-12 pure-u-lg-2-3"><input name="ssid" type="text" action="reconnect" class="pure-u-23-24" value="" size="8" tabindex="0" placeholder="Network SSID" required autocomplete="false" /></div>
<div class="pure-u-1-12 pure-u-lg-1-12"><button type="button" class="pure-button button-more-network pure-u-1">...</button></div>
<div class="pure-u-5-6 pure-u-lg-2-3"><input name="ssid" type="text" action="reconnect" class="pure-u-23-24" value="" size="8" tabindex="0" placeholder="Network SSID" required autocomplete="false" /></div>
<div class="pure-u-1-6 pure-u-lg-1-12"><button type="button" class="pure-button button-more-network pure-u-1">...</button></div>
<label class="pure-u-1 pure-u-lg-1-4 more">Password</label>
<input class="pure-u-1 pure-u-lg-3-4 more" name="pass" type="password" action="reconnect" value="" tabindex="0" autocomplete="false" />


Loading…
Cancel
Save