Finish developing new features
This commit is contained in:
@@ -79,14 +79,13 @@ $(function() {
|
||||
}
|
||||
|
||||
self.handleIO = function(data, event){
|
||||
alert(data[1]);
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// dataType: "json",
|
||||
// data: {"io": data.pin, "status": data.value},
|
||||
// url: "/plugin/enclosure/handleIO",
|
||||
// async: false
|
||||
// });
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
data: {"io": data[0], "status": data[1]},
|
||||
url: "/plugin/enclosure/handleIO",
|
||||
async: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,13 @@
|
||||
</table>
|
||||
|
||||
<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>
|
||||
<button type="submit" data-bind="click: handleIO.bind($data, ['io1', 'on']), enable: settings.settings.plugins.enclosure.io1Enable && isConnected()" class="btn">Turn on</button>
|
||||
|
||||
<h4><p data-bind="html: settings.settings.plugins.enclosure.io2Label"></p></h4>
|
||||
|
||||
<h4><p data-bind="html: settings.settings.plugins.enclosure.io3Label"></p></h4>
|
||||
|
||||
<h4><p data-bind="html: settings.settings.plugins.enclosure.io4Label"></p></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user