mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-23 15:10:06 +01:00
Added continous AP scan
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
function getResponse(adr, callback, timeoutCallback = function(){location.reload()}, timeout = 5000){
|
||||
function getResponse(adr, callback, timeoutCallback = function(){location.reload()}, timeout = 8000){
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if(xmlhttp.readyState == 4){
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
<p class="small" id="wpa_info">
|
||||
<br />
|
||||
WPA* = WPA/WPA2 auto mode
|
||||
<br>
|
||||
continous scan: <button onclick="startConScan()" id="startStopScan">start</button>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
@@ -63,9 +65,12 @@
|
||||
var scanBtn = document.getElementById('apScanStart');
|
||||
var scanInfo = document.getElementById('scanInfo');
|
||||
var apMAC = document.getElementById('apMAC');
|
||||
var startStopScan = document.getElementById('startStopScan');
|
||||
var autoScan = false;
|
||||
var canScan = true;
|
||||
|
||||
function toggleBtn(onoff){
|
||||
if(onoff){
|
||||
if(onoff && !autoScan){
|
||||
scanInfo.style.visibility = 'hidden';
|
||||
scanBtn.style.visibility = 'visible';
|
||||
}else{
|
||||
@@ -116,20 +121,32 @@
|
||||
tr += '</tr>';
|
||||
}
|
||||
table.innerHTML = tr;
|
||||
canScan = true;
|
||||
});
|
||||
}
|
||||
|
||||
function scan(){
|
||||
canScan = false;
|
||||
toggleBtn(false);
|
||||
getResponse("APScan.json",function(responseText){
|
||||
if(responseText == "true") getResults();
|
||||
else alert("error");
|
||||
toggleBtn(true);
|
||||
},function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function startConScan(){
|
||||
if(autoScan){
|
||||
autoScan = false;
|
||||
startStopScan.innerHTML = "start";
|
||||
toggleBtn(true);
|
||||
}else{
|
||||
autoScan = true;
|
||||
startStopScan.innerHTML = "stop";
|
||||
toggleBtn(false);
|
||||
}
|
||||
}
|
||||
|
||||
function select(num){
|
||||
getResponse("APSelect.json?num="+num,function(responseText){
|
||||
if(responseText == "true") getResults();
|
||||
@@ -138,5 +155,10 @@
|
||||
}
|
||||
|
||||
getResults();
|
||||
|
||||
setInterval(function(){
|
||||
if(autoScan && canScan) scan();
|
||||
},1000);
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user