ESP8266 part of the f105-motor-demo project (see f105-motor-demo_stm32)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
f105-motor-demo_esp/html/wifi/connecting.html

43 lines
1.2 KiB

<html><head><title>Connecting...</title>
<link rel="stylesheet" type="text/css" href="/wifi/style.css">
<script type="text/javascript" src="/wifi/140medley.min.js"></script>
<script type="text/javascript">
var xhr=j();
function getStatus() {
xhr.open("GET", "/wifi/connstatus");
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status>=200 && xhr.status<300) {
var data=JSON.parse(xhr.responseText);
if (data.status=="idle") {
$("#status").innerHTML="Preparing to connect...";
window.setTimeout(getStatus, 1000);
} else if (data.status=="success") {
$("#status").innerHTML="Connected! Got IP "+data.ip+". If you're in the same network, you can access it <a href=\"http://"+data.ip+"/\">here</a>.";
} else if (data.status=="working") {
$("#status").innerHTML="Trying to connect to selected access point...";
window.setTimeout(getStatus, 1000);
} else if (data.status=="fail") {
$("#status").innerHTML="Connection failed. Check password and selected AP.<br><a href=\"/wifi\">Go Back</a>";
}
}
}
xhr.send();
}
window.onload=function(e) {
getStatus();
};
</script>
</head>
<body>
<div id="main">
<h2>Connecting to AP...</h2>
<p>Status:<br />
<div id="status">...</div>
</p>
</div>
</body>
</html>