This commit is contained in:
Vitor de Miranda Henrique
2016-12-09 13:21:38 -08:00
parent c45f4133e0
commit aa9722a150
2 changed files with 9 additions and 9 deletions

View File

@@ -79,14 +79,14 @@ $(function() {
}
self.handleIO = function(data, event){
alert(data.pin + " " + data.value);
$.ajax({
type: "GET",
dataType: "json",
data: {"io": data.pin, "status": data.value},
url: "/plugin/enclosure/handleIO",
async: false
});
alert(data);
// $.ajax({
// type: "GET",
// dataType: "json",
// data: {"io": data.pin, "status": data.value},
// url: "/plugin/enclosure/handleIO",
// async: false
// });
}
}

View File

@@ -33,7 +33,7 @@
</tr>
</table>
<p data-bind="html: settings.settings.plugins.enclosure.io1Label"></p>
<h4><p data-bind="html: settings.settings.plugins.enclosure.io1Label"></p></h4>
<button type="submit" data-bind="click: handleIO.bind($data, 'io1', 'on')" class="btn">Turn on</button>
<button type="submit" data-bind="click: handleIO.bind($data, 'io1', 'off'), enable: settings.settings.plugins.enclosure.io1Enable && isConnected()" class="btn">Turn off</button>