send_http, 扫描接口

This commit is contained in:
zogodo
2019-09-28 21:42:51 +08:00
parent fd1e7402f5
commit 5607f25d09
5 changed files with 87 additions and 50 deletions

View File

@@ -129,7 +129,7 @@
<option value="2">China-Net</option>
<option value="3">CMCT</option>
</select>
<button id="rescan">Rescan</button>
<button id="rescan" onclick="Rescan()">Rescan</button>
</td>
</tr>
<tr>
@@ -319,6 +319,29 @@ function SubmitNetwork() {
}
}
var get_ret = false;
function Rescan() {
HttpPost("/wifi/scan", function (re) {
alert(re);
if (re == "OK") {
get_ret = true;
window.setTimeout(GetScanResult, 1000);
}
});
}
var tt = 5;
function GetScanResult() {
HttpGet("/wifi/scan", function (re) {
console.log(re);
if (get_ret && tt <= 0) {
get_ret = 0
}
window.setTimeout(GetScanResult, 1000);
tt--;
});
}
</script>
</body>
</html>