From 1f39bf643466b788024524f9e2ed8b4a804eb01a Mon Sep 17 00:00:00 2001 From: Wouter R Date: Mon, 8 Apr 2013 01:20:45 +0200 Subject: [PATCH] Add reconfiguration interface to support more generic and readable reconfiguring; fix js/jq URLs; misc minor fixes. --- src/admin/autowifi.html | 10 +- src/admin/autowifi.js | 13 +- src/admin/jquery-1.9.1.min.js | 5 + src/autowifi.lua | 63 +++++----- src/ext/www/.autowifi-inplace | 0 src/ext/www/cgi-bin/wfcf | 1 + src/ext/www/index.html | 2 +- src/reconf.lua | 222 ++++++++++++++++++++++++++++++++++ src/util.lua | 47 +++++++ src/wifihelper.lua | 54 +-------- 10 files changed, 326 insertions(+), 91 deletions(-) create mode 100644 src/admin/jquery-1.9.1.min.js create mode 100644 src/ext/www/.autowifi-inplace create mode 120000 src/ext/www/cgi-bin/wfcf create mode 100644 src/reconf.lua diff --git a/src/admin/autowifi.html b/src/admin/autowifi.html index 6720974..b4c1ad3 100644 --- a/src/admin/autowifi.html +++ b/src/admin/autowifi.html @@ -3,8 +3,8 @@ Wireless configuration - - + + @@ -28,10 +28,10 @@ - -
+ +
Known networks
- + diff --git a/src/admin/autowifi.js b/src/admin/autowifi.js index bcd8c2f..ac31df2 100644 --- a/src/admin/autowifi.js +++ b/src/admin/autowifi.js @@ -55,9 +55,11 @@ function fetchNetworkState() { if (data.status == "ERR") setResult(data.msg, true); var net = parseNetLine(data.payload); var modeText = "Unknown device mode ('" + net.mode + "')"; - if (net.mode == "ap") modeText = "Access point mode"; - else if (net.mode == "sta") modeText = "Client mode"; - $("#wlan_state").text(modeText + " (SSID: " + net.ssid + "; BSSID: " + net.bssid + "; channel: " + net.channel + ")"); + if (net.mode == "ap") { + $("#wlan_state").text("Access point mode"); + } else if (net.mode == "sta") { + $("#wlan_state").text("Client mode (SSID: " + net.ssid + "; BSSID: " + net.bssid + "; channel: " + net.channel + ")"); + } }); } @@ -72,8 +74,9 @@ function fetchAvailableNetworks() { options.empty(); $.each(data, function(index,value) { if (value != "") { - var ssid = parseNetLine(value).ssid; - options.append($("