net/wol: more user feedback + remove OpenVPN from selection - maybe IPsec too

This commit is contained in:
Fabian Franz
2018-03-22 18:00:29 +01:00
parent 699f1f28a3
commit 23bb90918c
2 changed files with 13 additions and 1 deletions
@@ -10,6 +10,7 @@
<default></default>
<filters>
<enable>/^(?!0).*$/</enable>
<if>/^(?!openvpn|ipsec|enc).*$/i</if>
</filters>
</interface>
<mac type="TextField">
@@ -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);
});
});