Testing
This commit is contained in:
@@ -78,11 +78,11 @@ $(function() {
|
||||
return "off";
|
||||
}
|
||||
|
||||
self.handleIO = function(pin, value){
|
||||
self.handleIO = function(data, event){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
data: {"io": pin, "status": value},
|
||||
data: {"io": data.pin, "status": data.value},
|
||||
url: "/plugin/enclosure/handleIO",
|
||||
async: false
|
||||
});
|
||||
|
||||
@@ -32,9 +32,12 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
</table>
|
||||
<h4 data-bind="html: settings.settings.plugins.enclosure.io1Label "> </h4>
|
||||
<button type="submit" data-bind="click: handleIO(io1,on), enable: settings.settings.plugins.enclosure.io1Enable && isConnected()" class="btn">Turn on</button>
|
||||
<button type="submit" data-bind="click: handleIO(io1,off), enable: settings.settings.plugins.enclosure.io1Enable && isConnected()" class="btn">Turn off</button>
|
||||
<h4 data-bind="html: io1Label "> </h4>
|
||||
|
||||
<button type="submit" data-bind="click: handleIO.bind($data, 'io1', 'on') , enable: settings.settings.plugins.enclosure.io1Enable && isConnected()" 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>
|
||||
|
||||
<h4> {{ settings.settings.plugins.enclosure.io1Label}} </h4>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user