From bde68d8e30648f7a167a60a2362776af994aea45 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 4 Apr 2023 22:05:25 +0200 Subject: [PATCH] Add system-reset ajax handler --- app/js/custom.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/js/custom.js b/app/js/custom.js index 77d87dd7..d109f080 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -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 += ''; $('#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(){