[PATCH v3 3/4] fff-web: Enable 5 GHz in wifiscan.html
Adrian Schmutzler
freifunk at adrianschmutzler.de
So Nov 26 14:01:39 CET 2017
This externalizes writing the table to a function and switches
to wXap instead of wXmesh to support KeyXchangeV2 better.
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
Introduced in v3.
---
.../fff-web/files/www/ssl/cgi-bin/wifiscan.html | 52 +++++++++++++++-------
1 file changed, 35 insertions(+), 17 deletions(-)
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html
index cc2c3b1..f9186d2 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html
@@ -13,27 +13,45 @@ readIWinfo() {
"<!-- \\5 --><tr><'${ssid}'>\\2</'${ssid}'><td>\\4</td><td>\\5 dBm</td><td>\\3</td><'${mac}'>\\1</'${mac}'><td>\\6</td></tr>", "g"); print r;}' | sort -n | sed 's#&#\&#'
# The HTML comment contains the signal quality to allow sorting
}
+printWifiScan() {
+ local iface=$1
+ local freq="2.4 GHz"
+ if [ "$iface" = "w5ap" ] || [ "$iface" = "w5mesh" ] ; then
+ freq="5 GHz"
+ fi
%>
-<table style="width: 100%">
-<tr><td>
-<fieldset>
- <legend>Wifi Scan</legend>
- <table class="wifitable">
- <tr>
- <th>Name</th>
- <th>Kanal</th>
- <th>Signal</th>
- <th>Typ</th>
- <th>MAC</th>
- <th>Encryption</th>
- </tr>
+ <tr><td>
+ <fieldset>
+ <legend>Wifi Scan: <%= "$freq" %></legend>
+ <table class="wifitable">
+ <tr>
+ <th>Name</th>
+ <th>Kanal</th>
+ <th>Signal</th>
+ <th>Typ</th>
+ <th>MAC</th>
+ <th>Encryption</th>
+ </tr>
<%
-readIWinfo "w2mesh" "td" "td"
+ readIWinfo "$iface" "td" "td"
+%>
+ </table>
+ </fieldset>
+ </td></tr>
+<%
+}
+
+%>
+<table style="width: 100%">
+<%
+if uci -q get wireless.w2ap > /dev/null ; then
+ printWifiScan "w2ap"
+fi
+if uci -q get wireless.w5ap > /dev/null ; then
+ printWifiScan "w5ap"
+fi
%>
- </table>
-</fieldset>
-</td></tr>
</table>
<%in /www/ssl/cgi-bin/footer %>
--
2.7.4
Mehr Informationen über die Mailingliste franken-dev