|
@ -36,6 +36,10 @@ |
|
|
<fieldset> |
|
|
<fieldset> |
|
|
<legend class="des">WiFi</legend> |
|
|
<legend class="des">WiFi</legend> |
|
|
<p>Enter the credentials to your prefered WiFi station. After rebooting the device tries to connect with this information.</p> |
|
|
<p>Enter the credentials to your prefered WiFi station. After rebooting the device tries to connect with this information.</p> |
|
|
|
|
|
<label for="networks">Avail Networks</label> |
|
|
|
|
|
<select name="networks" id="networks" onChange="selNet()"> |
|
|
|
|
|
<option value="-1">scanning ...</option> |
|
|
|
|
|
</select> |
|
|
<label for="ssid">SSID</label> |
|
|
<label for="ssid">SSID</label> |
|
|
<input type="text" name="ssid" class="text"/> |
|
|
<input type="text" name="ssid" class="text"/> |
|
|
<label for="pwd">Password</label> |
|
|
<label for="pwd">Password</label> |
|
@ -377,12 +381,35 @@ |
|
|
parseRadio(root["radio"]); |
|
|
parseRadio(root["radio"]); |
|
|
parseSerial(root["serial"]); |
|
|
parseSerial(root["serial"]); |
|
|
} |
|
|
} |
|
|
|
|
|
getAjax('/api/setup/networks', listNetworks); |
|
|
|
|
|
window.setInterval("getAjax('/api/setup/networks', listNetworks)", 7000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function listNetworks(root) { |
|
|
|
|
|
if(root["networks"].length > 0) { |
|
|
|
|
|
var s = document.getElementById("networks"); |
|
|
|
|
|
var i, l = s.options.length - 1; |
|
|
|
|
|
for(i = l; i >= 0; i--) { |
|
|
|
|
|
s.remove(i); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(i = 0; i < root["networks"].length; i++) { |
|
|
|
|
|
s.appendChild(opt(root["networks"][i]["ssid"], root["networks"][i]["ssid"] + " (" + root["networks"][i]["rssi"] + " dBm)")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function selNet() { |
|
|
|
|
|
var s = document.getElementById("networks"); |
|
|
|
|
|
var e = document.getElementsByName("ssid")[0]; |
|
|
|
|
|
e.value = s.value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
hiddenInput = document.getElementById("disclaimer") |
|
|
hiddenInput = document.getElementById("disclaimer") |
|
|
hiddenInput.value = sessionStorage.getItem("gDisclaimer"); |
|
|
hiddenInput.value = sessionStorage.getItem("gDisclaimer"); |
|
|
|
|
|
|
|
|
getAjax("/api/setup", parse); |
|
|
getAjax("/api/setup", parse); |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |
|
|