1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Progress commit: bootstrap modal event handlers

This commit is contained in:
billz 2021-02-07 11:59:16 +00:00
parent 12dd5d824b
commit 6432efcf34

View File

@ -248,6 +248,56 @@ $('#hostapdModal').on('shown.bs.modal', function (e) {
$('#configureClientModal').on('shown.bs.modal', function (e) {
});
$('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) {
var modalDiv = $(e.delegateTarget);
var cfg_id = $(this).data('recordId');
console.log(cfg_id);
//console.log(modalDiv.parent().find('.js-remove-openvpn-client').attr('data-record-id'));
//console.log(modalDiv.parent().find(
$.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){
jsonData = JSON.parse(data);
console.log(jsonData);
//$(this).closest('js-openvpn-client-row').fadeOut(300);
$("#ovpn-confirm-delete").modal('hide');
if(jsonData['return'] == 0) {
// do something
} else if(jsonData['return'] == 2) {
// something else
}
});
});
$('#ovpn-confirm-delete').on('show.bs.modal', function (e) {
var data = $(e.relatedTarget).data();
$('.btn-delete', this).data('recordId', data.recordId);
});
$('#ovpn-confirm-activate').on('click', '.btn-activate', function (e) {
//var modalDiv = $(e.delegateTarget);
var cfg_id = $(this).data('recordId');
console.log(cfg_id);
$.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){
jsonData = JSON.parse(data);
console.log(jsonData);
//$(this).closest('js-openvpn-client-row').fadeOut(300);
$("#ovpn-confirm-activate").modal('hide');
if(jsonData['return'] == 0) {
// do something
} else if(jsonData['return'] == 2) {
// something else
}
});
});
$('#ovpn-confirm-activate').on('shown.bs.modal', function (e) {
var data = $(e.relatedTarget).data();
console.log(data.recordId);
$('.btn-activate', this).data('recordId', data.recordId);
});
/*
Sets the wirelss channel select options based on hw_mode and country_code.