Added nice icons for encryption and rssi

pull/30/head
Jeroen Domburg 10 years ago
parent f1d80059d6
commit 35988080a1
  1. 1
      html/style.css
  2. BIN
      html/wifi/icons.png
  3. 8
      html/wifi/style.css
  4. 14
      html/wifi/wifi.tpl
  5. 17
      user/cgiwifi.c

@ -14,3 +14,4 @@ body {
margin: 0 auto;
padding: 20px
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

@ -14,3 +14,11 @@ body {
margin: 0 auto;
padding: 20px
}
.icon {
background-image: url("icons.png");
background-color: transparent;
width: 32px;
height: 32px;
display: inline-block;
}

@ -10,6 +10,16 @@ function createInputForAp(ap) {
if (ap.essid=="" && ap.rssi==0) return;
var div=document.createElement("div");
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");
input.type="radio";
input.name="essid";
@ -18,8 +28,10 @@ function createInputForAp(ap) {
input.id="opt-"+ap.essid;
var label=document.createElement("label");
label.htmlFor="opt-"+ap.essid;
label.textContent=ap.essid+" (rssi "+ap.rssi+")";
label.textContent=ap.essid;
div.appendChild(input);
div.appendChild(rssi);
div.appendChild(encrypt);
div.appendChild(label);
return div;
}

@ -95,15 +95,6 @@ static void ICACHE_FLASH_ATTR wifiStartScan() {
// int x;
if (cgiWifiAps.scanInProgress) return;
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);
}
@ -145,13 +136,6 @@ int ICACHE_FLASH_ATTR cgiWiFiScan(HttpdConnData *connData) {
//Temp store for new ap info.
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
//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
#if 1
os_timer_arm(&reassTimer, 1000, 0);
httpdRedirect(connData, "connecting.html");
#else
httpdRedirect(connData, "/wifi");

Loading…
Cancel
Save