diff --git a/common.js b/common.js index f131eb2..5fcbf41 100644 --- a/common.js +++ b/common.js @@ -113,23 +113,13 @@ function check_vpn(service) { method: 'GET', success: function(data) { console.log('check_vpn: '+data); - if (data=="1") { // save_vpn has finished or VPN ON - const vpn_div = document.getElementById("vpn"); - console.log('vpn_div: '+vpn_div); - if (vpn_div) { - vpn_div.innerHTML = 'VPN start process has finished'; - setTimeout(function() { - document.getElementById('installAppsBtn').click(); - }, 2000); - } - else { + if (data=="1") { // VPN ON $('#pro_off').hide(); $('#pro_on').show(); $('#vpn_off').hide(); $('#vpn_on').show(); //document.getElementById('vpnToggle').checked = true; //document.querySelector(".switch-label").textContent = "ON"; - } } else if (data=="2") { $('#pro_off').hide(); @@ -152,13 +142,38 @@ function check_vpn(service) { }); } +function check_save_vpn(service) { + var url = 'scan.php?op=check_vpn'; + jQuery.ajax({ + url: url, + method: 'GET', + success: function(data) { + console.log('check_save_vpn: '+data); + if (data=="1") { // save_vpn has finished or VPN ON + const vpn_div = document.getElementById("vpn"); + if (vpn_div) { + vpn_div.innerHTML = '