mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-24 07:29:59 +01:00
Improved web responsiveness
By only forcing a channel change when required by the attack
This commit is contained in:
@@ -18,6 +18,12 @@ function draw() {
|
||||
getE("allpkts").innerHTML = esc(attackJSON[3] + "");
|
||||
}
|
||||
|
||||
function stopAll() {
|
||||
getFile("run?cmd=stop attack", function () {
|
||||
load();
|
||||
});
|
||||
}
|
||||
|
||||
function start(mode) {
|
||||
switch (mode) {
|
||||
case 0:
|
||||
@@ -31,6 +37,7 @@ function start(mode) {
|
||||
break;
|
||||
}
|
||||
getFile("run?cmd=attack" + (attackJSON[0][0] ? " -d" : "") + (attackJSON[1][0] ? " -b" : "") + (attackJSON[2][0] ? " -p" : ""), function () {
|
||||
setTimeout(load, 2000);
|
||||
draw();
|
||||
});
|
||||
}
|
||||
@@ -38,6 +45,8 @@ function start(mode) {
|
||||
function load() {
|
||||
getFile("attack.json", function (response) {
|
||||
attackJSON = JSON.parse(response);
|
||||
console.log(response);
|
||||
showMessage("connected");
|
||||
draw();
|
||||
});
|
||||
}
|
||||
@@ -150,7 +150,8 @@ function scan(type) {
|
||||
+ " -ch " + getE("ch").options[getE("ch").selectedIndex].value;
|
||||
getFile("run?cmd=" + cmdStr);
|
||||
duts = parseInt(type);
|
||||
setTimeout(buttonFunc, elxtime)
|
||||
setTimeout(buttonFunc, elxtime);
|
||||
setTimeout(load, elxtime);
|
||||
}
|
||||
|
||||
function buttonFunc() {
|
||||
@@ -171,6 +172,7 @@ function load() {
|
||||
getFile("run?cmd=save scan", function () {
|
||||
getFile("scan.json", function (res) {
|
||||
scanJson = JSON.parse(res);
|
||||
showMessage("connected");
|
||||
drawScan();
|
||||
});
|
||||
});
|
||||
@@ -178,6 +180,7 @@ function load() {
|
||||
getFile("run?cmd=save names", function () {
|
||||
getFile("names.json", function (res) {
|
||||
nameJson = JSON.parse(res);
|
||||
showMessage("connected");
|
||||
drawNames();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ var settingsJson = {};
|
||||
function load() {
|
||||
getFile("settings.json", function (res) {
|
||||
settingsJson = JSON.parse(res);
|
||||
showMessage("connected");
|
||||
draw();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,9 +29,17 @@ function convertLineBreaks(str) {
|
||||
}
|
||||
|
||||
function showMessage(msg, closeAfter) {
|
||||
getE("status").style.backgroundColor = "#d33";
|
||||
console.error("disconnected (" + msg + ")");
|
||||
getE("status").innerHTML = "disconnected";
|
||||
if (msg.startsWith("ERROR")) {
|
||||
getE("status").style.backgroundColor = "#d33";
|
||||
getE("status").innerHTML = "disconnected";
|
||||
|
||||
console.error("disconnected (" + msg + ")");
|
||||
} else {
|
||||
getE("status").style.backgroundColor = "#3c5";
|
||||
getE("status").innerHTML = "connected";
|
||||
|
||||
console.log("" + msg + "");
|
||||
}
|
||||
}
|
||||
|
||||
function getFile(adr, callback, timeout, method, onTimeout, onError) {
|
||||
|
||||
@@ -6,6 +6,7 @@ function load() {
|
||||
getFile("run?cmd=save ssids", function () {
|
||||
getFile("ssids.json", function (res) {
|
||||
ssidJson = JSON.parse(res);
|
||||
showMessage("connected");
|
||||
draw();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user