mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-21 14:09:59 +01:00
more debug
This commit is contained in:
@@ -32,7 +32,15 @@ function getEncryption(num) {
|
|||||||
function getResults() {
|
function getResults() {
|
||||||
toggleScan(true);
|
toggleScan(true);
|
||||||
getResponse("APScanResults.json", function(responseText) {
|
getResponse("APScanResults.json", function(responseText) {
|
||||||
var res = JSON.parse(responseText);
|
var res;
|
||||||
|
try {
|
||||||
|
res = JSON.parse(responseText);
|
||||||
|
} catch(e) {
|
||||||
|
// wut
|
||||||
|
showMessage("JSON Parsing failed :-(", 2500);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// TODO: more sanity checks on res && res.aps
|
||||||
res.aps = res.aps.sort(compare);
|
res.aps = res.aps.sort(compare);
|
||||||
networkInfo.innerHTML = res.aps.length;
|
networkInfo.innerHTML = res.aps.length;
|
||||||
apMAC.innerHTML = "";
|
apMAC.innerHTML = "";
|
||||||
|
|||||||
@@ -14,7 +14,15 @@ var data = {};
|
|||||||
|
|
||||||
function getResults() {
|
function getResults() {
|
||||||
getResponse("attackInfo.json", function(responseText) {
|
getResponse("attackInfo.json", function(responseText) {
|
||||||
var res = JSON.parse(responseText);
|
var res;
|
||||||
|
try {
|
||||||
|
res = JSON.parse(responseText);
|
||||||
|
} catch(e) {
|
||||||
|
// wut
|
||||||
|
showMessage("JSON Parsing failed :-(", 2500);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// TODO: more sanity checks on res && res.aps
|
||||||
var aps = "";
|
var aps = "";
|
||||||
var clients = "";
|
var clients = "";
|
||||||
var tr = "<tr><th>Attack</th><th>Status</th><th>Start/Stop</th></tr>";
|
var tr = "<tr><th>Attack</th><th>Status</th><th>Start/Stop</th></tr>";
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ function showMessage(msg, closeAfter){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getResponse(adr, callback, timeoutCallback, timeout, method){
|
function getResponse(adr, callback, timeoutCallback, timeout, method){
|
||||||
|
|
||||||
if(timeoutCallback === undefined) {
|
if(timeoutCallback === undefined) {
|
||||||
timeoutCallback = function(){
|
timeoutCallback = function(){
|
||||||
showMessage("error loading "+adr);
|
showMessage("Timeout loading "+adr);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if(timeout === undefined) timeout = 8000;
|
if(timeout === undefined) timeout = 8000;
|
||||||
@@ -49,4 +51,12 @@ function getResponse(adr, callback, timeoutCallback, timeout, method){
|
|||||||
xmlhttp.send();
|
xmlhttp.send();
|
||||||
xmlhttp.timeout = timeout;
|
xmlhttp.timeout = timeout;
|
||||||
xmlhttp.ontimeout = timeoutCallback;
|
xmlhttp.ontimeout = timeoutCallback;
|
||||||
|
|
||||||
|
xmlhttp.onabort = function(e) {
|
||||||
|
showMessage("ABORT "+adr);
|
||||||
|
};
|
||||||
|
xmlhttp.onerror = function(e) {
|
||||||
|
showMessage("ERROR loading "+adr +" :: "+ this.statusText);
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user