Improved the way stations save their AP

There was the problem that when the AP list get's sorted (when starting an attack for example), the pointers to the stations would become messed up.
This commit is contained in:
Stefan Kremser
2018-04-09 12:24:36 +02:00
parent ef21d3201e
commit 396d8e69fe
11 changed files with 48 additions and 50 deletions

View File

@@ -68,7 +68,10 @@ function drawScan(){
for(var i=0;i<scanJson.stations.length;i++){
selected = scanJson.stations[i][scanJson.stations[i].length-1];
ap = "";
if(scanJson.stations[i][5] >= 0)
ap = esc(scanJson.aps[scanJson.stations[i][5]][0]);
html += (selected ? "<tr class='selected'>" : "<tr>")
+ "<td class='id'>"+i+"</td>" // ID
+ "<td class='vendor'>"+esc(scanJson.stations[i][3])+"</td>" // Vendor
@@ -76,7 +79,7 @@ function drawScan(){
+ "<td class='ch'>"+esc(scanJson.stations[i][1])+"</td>" // Ch
+ "<td class='name'>"+(scanJson.stations[i][2].length > 0 ? esc(scanJson.stations[i][2]) : "<button onclick='add(1,"+i+")'>"+lang("add")+"</button>")+"</td>" // Name
+ "<td class='pkts'>"+esc(scanJson.stations[i][4])+"</td>" // Pkts
+ "<td class='ap'>"+esc(scanJson.aps[scanJson.stations[i][5]][0])+"</td>" // AP
+ "<td class='ap'>"+ap+"</td>" // AP
+ "<td class='lastseen'>"+esc(scanJson.stations[i][6])+"</td>" // Last seen
// Select
+ "<td class='selectColumn'><label class='checkBoxContainer'><input type='checkbox' "+(selected ? "checked" : "")+" onclick='selectRow(1,"+i+","+(selected ? "false" : "true")+")'><span class='checkmark'></span></label></td>"