Added nice icons for encryption and rssi
This commit is contained in:
@@ -14,3 +14,4 @@ body {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 20px
|
padding: 20px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 914 B |
@@ -14,3 +14,11 @@ body {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 20px
|
padding: 20px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
background-image: url("icons.png");
|
||||||
|
background-color: transparent;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
+13
-1
@@ -10,6 +10,16 @@ function createInputForAp(ap) {
|
|||||||
if (ap.essid=="" && ap.rssi==0) return;
|
if (ap.essid=="" && ap.rssi==0) return;
|
||||||
var div=document.createElement("div");
|
var div=document.createElement("div");
|
||||||
div.id="apdiv";
|
div.id="apdiv";
|
||||||
|
var rssi=document.createElement("div");
|
||||||
|
var rssiVal=Math.floor(ap.rssi/5)*32;
|
||||||
|
rssi.className="icon";
|
||||||
|
rssi.style.backgroundPosition="0px "+rssiVal+"px";
|
||||||
|
var encrypt=document.createElement("div");
|
||||||
|
var encVal="-64"; //assume wpa/wpa2
|
||||||
|
if (ap.enc=="0") encVal="0"; //open
|
||||||
|
if (ap.enc=="1") encVal="-32"; //wep
|
||||||
|
encrypt.className="icon";
|
||||||
|
encrypt.style.backgroundPosition="32px "+encVal+"px";
|
||||||
var input=document.createElement("input");
|
var input=document.createElement("input");
|
||||||
input.type="radio";
|
input.type="radio";
|
||||||
input.name="essid";
|
input.name="essid";
|
||||||
@@ -18,8 +28,10 @@ function createInputForAp(ap) {
|
|||||||
input.id="opt-"+ap.essid;
|
input.id="opt-"+ap.essid;
|
||||||
var label=document.createElement("label");
|
var label=document.createElement("label");
|
||||||
label.htmlFor="opt-"+ap.essid;
|
label.htmlFor="opt-"+ap.essid;
|
||||||
label.textContent=ap.essid+" (rssi "+ap.rssi+")";
|
label.textContent=ap.essid;
|
||||||
div.appendChild(input);
|
div.appendChild(input);
|
||||||
|
div.appendChild(rssi);
|
||||||
|
div.appendChild(encrypt);
|
||||||
div.appendChild(label);
|
div.appendChild(label);
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,15 +95,6 @@ static void ICACHE_FLASH_ATTR wifiStartScan() {
|
|||||||
// int x;
|
// int x;
|
||||||
if (cgiWifiAps.scanInProgress) return;
|
if (cgiWifiAps.scanInProgress) return;
|
||||||
cgiWifiAps.scanInProgress=1;
|
cgiWifiAps.scanInProgress=1;
|
||||||
#if 0
|
|
||||||
//Not sure if this is still needed.
|
|
||||||
x=wifi_station_get_connect_status();
|
|
||||||
if (x!=STATION_GOT_IP) {
|
|
||||||
//Unit probably is trying to connect to a bogus AP. This messes up scanning. Stop that.
|
|
||||||
os_printf("STA status = %d. Disconnecting STA...\n", x);
|
|
||||||
wifi_station_disconnect();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
wifi_station_scan(NULL, wifiScanDoneCb);
|
wifi_station_scan(NULL, wifiScanDoneCb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,13 +136,6 @@ int ICACHE_FLASH_ATTR cgiWiFiScan(HttpdConnData *connData) {
|
|||||||
//Temp store for new ap info.
|
//Temp store for new ap info.
|
||||||
static struct station_config stconf;
|
static struct station_config stconf;
|
||||||
|
|
||||||
/*
|
|
||||||
ToDo:
|
|
||||||
- Thoroughly test this code
|
|
||||||
- Simplify if possible. The cascaded delayed routines are probably not
|
|
||||||
needed anymore. I hope.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//This routine is ran some time after a connection attempt to an access point. If
|
//This routine is ran some time after a connection attempt to an access point. If
|
||||||
//the connect succeeds, this gets the module in STA-only mode.
|
//the connect succeeds, this gets the module in STA-only mode.
|
||||||
@@ -213,7 +197,6 @@ int ICACHE_FLASH_ATTR cgiWiFiConnect(HttpdConnData *connData) {
|
|||||||
//Set to 0 if you want to disable the actual reconnecting bit
|
//Set to 0 if you want to disable the actual reconnecting bit
|
||||||
#if 1
|
#if 1
|
||||||
os_timer_arm(&reassTimer, 1000, 0);
|
os_timer_arm(&reassTimer, 1000, 0);
|
||||||
|
|
||||||
httpdRedirect(connData, "connecting.html");
|
httpdRedirect(connData, "connecting.html");
|
||||||
#else
|
#else
|
||||||
httpdRedirect(connData, "/wifi");
|
httpdRedirect(connData, "/wifi");
|
||||||
|
|||||||
Reference in New Issue
Block a user