Merge pull request #623 from opnsense/wol20

net/wol: bugfixes
This commit is contained in:
Fabian Franz BSc 2018-03-22 18:30:54 +01:00 committed by GitHub
commit 4dc09cda49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -1,5 +1,6 @@
PLUGIN_NAME= wol
PLUGIN_VERSION= 2.0.d
PLUGIN_REVISION= 1
PLUGIN_DEPENDS= wol
PLUGIN_COMMENT= Wake on LAN Service
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -10,6 +10,7 @@
<default></default>
<filters>
<enable>/^(?!0).*$/</enable>
<if>/^(?!openvpn|ipsec|enc).*$/i</if>
</filters>
</interface>
<mac type="TextField">

View file

@ -62,7 +62,18 @@ $( document ).ready(function() {
// link save button to API set action
$("#wakeAct").click(function(){
saveFormToEndpoint(url="/api/wol/wol/set", formid='frm_wol_wake',callback_ok=function(data){}, true);
ajaxCall(url="/api/wol/wol/set", data=getFormData('frm_wol_wake'),callback=function(data, status){
BootstrapDialog.show({
type: data.status == 'OK' ? BootstrapDialog.TYPE_SUCCESS : BootstrapDialog.TYPE_DANGER,
title: "{{ lang._("Result") }}",
message: (data.status == 'OK' ?
'{{ lang._('Magic packet was sent successfully.') }}' :
'{{ lang._('The packet was not sent due to an error. Please consult the logs.') }}<br />' +
$('<pre>').text(data.error_msg).html()
)
});
}, true);
});
});