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.
esp-link/html/wifi/connecting.html

45 lines
1.3 KiB

<html><head><title>Connecting... - ESP Link</title>
10 years ago
<link rel="stylesheet" type="text/css" href="/style.css">
<script type="text/javascript" src="140medley.min.js"></script>
<script type="text/javascript">
var xhr=j();
function getStatus() {
xhr.open("GET", "connstatus.cgi");
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status>=200 && xhr.status<300) {
var data=JSON.parse(xhr.responseText);
if (data.status=="idle" || data.status=="connecting") {
$("#status").innerHTML="Connecting...";
window.setTimeout(getStatus, 1000);
} else if (data.status=="got IP address") {
10 years ago
$("#status").innerHTML="Connected! Got IP "+data.ip+ ".<br/>" +
"If you're in the same network, you can access it <a href=\"http://"+data.ip+
"/\">here</a>.<br/>ESP Link will switch to STA-only mode in a few seconds.";
} else {
$("#status").innerHTML="Oops: " + data.status + ". Reason: " + data.reason +
"<br/>Check password and selected AP.<br/><a href=\"wifi.tpl\">Go Back</a>";
}
}
}
xhr.send();
}
window.onload=function(e) {
window.setTimeout(getStatus, 2000);
};
</script>
</head>
<body>
<div id="main">
<h1>ESP Link - Connecting</h1>
<h2>Connecting to AP...</h2>
<p>Status:
<span id="status">...</span>
</p>
</div>
</body>
</html>