mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Add system-reset ajax handler
This commit is contained in:
parent
0d0aee916e
commit
bde68d8e30
1 changed files with 9 additions and 4 deletions
|
@ -324,13 +324,18 @@ $('#ovpn-userpw,#ovpn-certs').on('click', function (e) {
|
|||
|
||||
$('#js-system-reset-confirm').on('click', function (e) {
|
||||
var resetHtml = $('#js-system-reset-confirm').attr('data-message');
|
||||
var successHtml = $('#js-system-reset-message').attr('data-message');
|
||||
var csrfToken = $('meta[name=csrf_token]').attr('content');
|
||||
resetHtml += '<i class="fas fa-cog fa-spin ml-2"></i>';
|
||||
$('#system-reset-message').html(resetHtml);
|
||||
$.post('ajax/networking/do_systemreset.php?',function(data){
|
||||
var responseText = JSON.parse(data);
|
||||
$('#system-reset-message').text(responseText);
|
||||
$.post('ajax/networking/do_sys_reset.php?',{'csrf_token':csrfToken},function(data){
|
||||
setTimeout(function(){
|
||||
$('#system-reset-message').text('Reset complete. Restart the hotspot for the changes to take effect.');
|
||||
var response = JSON.parse(data);
|
||||
console.log(response);
|
||||
//$('#system-reset-message').text(responseText);
|
||||
},1000);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
Loading…
Reference in a new issue