WOL widget fix (#2291)

fix button binding after cutting scripts from widgets
This commit is contained in:
kulikov-a
2021-03-21 20:36:09 +01:00
committed by GitHub
parent 45021cd069
commit 61a9282bea
2 changed files with 8 additions and 7 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
PLUGIN_NAME= wol
PLUGIN_VERSION= 2.3
PLUGIN_REVISION= 1
PLUGIN_VERSION= 2.4
PLUGIN_DEPENDS= wol
PLUGIN_COMMENT= Wake on LAN Service
PLUGIN_MAINTAINER= franco@opnsense.org
@@ -75,10 +75,12 @@ $wol = new Wol();
</tfoot>
</table>
<script>
$('.wakeupbtn').click(function(event) {
event.preventDefault();
var data = this.dataset;
$.post('/api/wol/wol/set', {'uuid': data['uuid']}, function(result) {
$("#dashboard_container").on("WidgetsReady", function() {
$('.wakeupbtn').click(function(event) {
event.preventDefault();
var data = this.dataset;
$.post('/api/wol/wol/set', {'uuid': data['uuid']}, function(result) {
});
})
});
})
</script>