-
Notifications
You must be signed in to change notification settings - Fork 89
/
devmac.html
78 lines (75 loc) · 2.36 KB
/
devmac.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<title>%l10n_title_devmac%</title>
<head>
<script type="text/javascript">
function detect()
{
var formdata = $($('form')[0]).serialize();
$('input').prop('disabled', true);
$('button').prop('disabled', true);
$('#fdata').empty();
$('#fhead').empty();
$('#fhead').append('<tr><th>%l10n_tbl_count%</th><th>%l10n_tbl_dev_short%</th><th>%l10n_tbl_probability%</th></tr>');
$('#fdata').append('<tr><td colspan=3><img src="img/loading.gif"></td></tr>');
$.post('3wifi.php?a=devicemac', formdata, function(d)
{
$('input').prop('disabled', false);
$('button').prop('disabled', false);
if (!d.result)
{
if (d.error == 'unauthorized')
{
$('#fdata > tr:first-child > :first-child').html(loginRequireMsg());
}
else
{
$('#fdata > tr:first-child > :first-child').text(errorStr(d.error));
}
return;
}
var res = '%l10n_find_results% '+ d.scores.length +' ('+ d.time.toFixed(2) +' %l10n_find_secs%)';
$('#found').text(res);
if (d.scores.length > 0)
{
$('#fdata').empty();
for (var i = 0; i < d.scores.length; i++)
{
$('#fdata').append('<tr><td>'+d.scores[i].count+'</td><td>'+encodeHTML(d.scores[i].name, true)+'</td><td style="text-align: left"><span class=perc></span><b> '+Math.round(d.scores[i].score * 100)+'%</b></td></tr>');
var perc = $('.perc:last');
var wid = 180;
perc.css('width', wid + 'px');
var chld = $('<span class=perc-data>');
chld.css('width', Math.round(d.scores[i].score * 100) + '%');
perc.html(chld);
}
} else {
$('#fdata > tr:first-child > :first-child').text('%l10n_dev_not_found%.');
}
}).fail(function(jqXHR, textStatus, errorThrown) {
$('#fdata > tr:first-child > :first-child').text('%l10n_err_data%.');
$('input').prop('disabled', false);
$('button').prop('disabled', false);
});
}
function initpage()
{
}
</script>
</head>
<body>
<p>%l10n_msg_devmac%</p>
<form id=fdeviceform enctype="multipart/form-data" method="POST" onsubmit="detect(); return false">
<table>
<tbody>
<tr><td>%l10n_str_bssid%</td><td><input name="bssid" type="text" value="" pattern="([0-9A-Fa-f]{2}[:-]?){5}[0-9A-Fa-f]{2}" autofocus /></td><td> (%l10n_bssid_format%)</td></tr>
</tbody>
<tbody>
<tr><td><input type=submit value="%l10n_btn_detect%" /></td><td id=found colspan=2></td></tr>
</tbody>
</table>
</form>
</br>
<table class=st1>
<tbody id=fhead></tbody>
<tbody id=fdata></tbody>
</table>
</body>