mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Progress commit: bootstrap modal event handlers
This commit is contained in:
parent
12dd5d824b
commit
6432efcf34
1 changed files with 50 additions and 0 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue