[PATCH v5 1/2] fff-web: Show WiFi channels and SSID

Tim Niemeyer tim at tn-x.org
So Nov 12 19:21:56 CET 2017


Am Sonntag, den 12.11.2017, 18:49 +0100 schrieb Tim Niemeyer:
> Hi
> 
> Eine Kleinigkeit inline.

Arg.. Quak.. Vergiss das. ;)

Tim


> 
> Am Montag, den 06.11.2017, 10:18 +0100 schrieb Adrian Schmutzler:
> > This patch introduced more detailed information about the
> > hood in the WebUI, i.e. channel and SSIDs.
> > 
> > The patch includes a reorganization of the columns.
> > 
> > Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> > Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> > 
> > ---
> > 
> > Changes in v2:
> >  - Rebased onto fff-hoods: Fix case of missing keyxchangev2data
> > 
> > Changes in v3:
> >  - Display client AP ssid
> >  - Display both value demanded by json and value actually set
> > 
> > Changes in v4:
> >  - Read/set-up hood data in separate file to make it reusable
> > 
> > Changes in v5:
> >  - Suppress uci wXap output
> > 
> > ---
> >  .../fff-hoods/files/lib/functions/fff/evalhoodinfo | 36 ++++++++++++++++
> >  .../fff/fff-web/files/www/ssl/cgi-bin/home.html    | 49 ++++++++--------------
> >  2 files changed, 54 insertions(+), 31 deletions(-)
> >  create mode 100644 src/packages/fff/fff-hoods/files/lib/functions/fff/evalhoodinfo
> > 
> > diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/evalhoodinfo b/src/packages/fff/fff-hoods/files/lib/functions/fff/evalhoodinfo
> > new file mode 100644
> > index 0000000..c487ea7
> > --- /dev/null
> > +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/evalhoodinfo
> > @@ -0,0 +1,36 @@
> > +#!/bin/sh
> > +# Copyright 2017 Adrian Schmutzler
> > +# License GPLv3
> > +
> > +. /lib/functions/fff/keyxchange
> > +
> > +jsonfile="$(getJsonPath)"
> > +if [ -n "$jsonfile" ] ; then
> > +	json_load "$(cat "$jsonfile")"
> > +	json_select hood
> > +	json_get_var mesh_type2 mesh_type2
> > +	json_get_var mesh_type5 mesh_type5
> > +	json_get_var chan2ghz channel2
> > +	json_get_var chan5ghz channel5
> > +	json_get_var essid essid
> > +else
> > +	mesh_type2="-"
> > +	mesh_type5="-"
> > +	chan2ghz="-"
> > +	chan5ghz="-"
> > +	essid="-"
> > +fi
> > +
> > +real_chan2ghz="--"
> > +real_chan5ghz="--"
> > +real_essid="-"
> Es gibt ggf zwei ESSID's.. für je 5 GHz und 2.4 GHz.
> 
> > +if uci -q get wireless.w2ap > /dev/null ; then
> > +	radio2="$(uci -q get wireless.w2ap.device)"
> > +	real_chan2ghz="$(uci -q get "wireless.${radio2}.channel")"
> > +	real_essid="$(uci -q get wireless.w2ap.ssid)"
> s.o.
> 
> > +fi
> > +if uci -q get wireless.w5ap > /dev/null ; then
> > +	radio5="$(uci -q get wireless.w5ap.device)"
> > +	real_chan5ghz="$(uci -q get "wireless.${radio5}.channel")"
> > +	real_essid="$(uci -q get wireless.w5ap.ssid)"
> s.o.
> 
> Tim
> 
> > +fi
> > diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> > index 7931ea9..21bd4e7 100755
> > --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> > +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> > @@ -1,7 +1,8 @@
> >  #!/usr/bin/haserl
> >  
> >  <%
> > -. /lib/functions/fff/keyxchange
> > +# read from keyxchangev2data
> > +. /lib/functions/fff/evalhoodinfo
> >  
> >  # prepare
> >  if [ "$REQUEST_METHOD" == "POST" ] ; then
> > @@ -49,23 +50,10 @@ else
> >  	internet_active="Nein"
> >  fi
> >  
> > -# read from keyxchangev2data
> > -. /lib/functions/fff/keyxchange
> > -jsonfile="$(getJsonPath)"
> > -if [ -n "$jsonfile" ] ; then
> > -	json_load "$(cat "$jsonfile")"
> > -	json_select hood
> > -	json_get_var mesh_type2 mesh_type2
> > -	json_get_var mesh_type5 mesh_type5
> > -else
> > -	mesh_type2="-"
> > -	mesh_type5="-"
> > -fi
> > -
> >  %>
> >  <table style="width: 100%;">
> >  <tr><td>
> > -<fieldset style="min-height: 15.05em;">
> > +<fieldset style="padding-bottom:12px">
> >  	<legend>System</legend>
> >  	<table>
> >  		<tr><th>Name:</th><td><%= ${HOSTNAME} %></td></tr>
> > @@ -80,8 +68,18 @@ fi
> >  		<tr><th>Uhrzeit:</th><td><% date %></td></tr>
> >  	</table>
> >  </fieldset>
> > +<fieldset style="padding-bottom:12px">
> > +	<legend>Netz: Freifunk</legend>
> > +	<table>
> > +		<tr><th>Nutzer:</th><td><% cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W' %></td></tr>
> > +		<tr><th>Empfangen:</th><td><% cat /sys/class/net/br-mesh/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
> > +		<tr><th>Gesendet:</th><td><% cat /sys/class/net/br-mesh/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
> > +		<tr><th>IPv4 Adressen:</th><td><% addr 4 br-mesh %></td></tr>
> > +		<tr><th>IPv6 Adressen:</th><td><% addr 6 br-mesh %></td></tr>
> > +	</table>
> > +</fieldset>
> >  </td><td>
> > -<fieldset style="min-height: 10em;">
> > +<fieldset style="padding-bottom:12px">
> >  	<legend>Software</legend>
> >  	<table>
> >  		<tr><th>Firmware Version:</th><td><%= ${FIRMWARE_VERSION} %></td></tr>
> > @@ -92,31 +90,20 @@ fi
> >  	</table>
> >  </fieldset>
> >  <form method="post">
> > -<fieldset style="min-height: 5em;">
> > +<fieldset style="padding-bottom:12px">
> >  	<legend>Hood</legend>
> >  	<table>
> >  		<tr><th style="width:200px">Hood:</th><td><% echo "$hood" %></td></tr>
> >  		<tr><th style="width:200px">Mesh-Type (2.4/5 GHz):</th><td><% echo "${mesh_type2} / ${mesh_type5}" %></td></tr>
> > +		<tr><th style="width:200px">Channel (2.4/5 GHz):</th><td>Gerät: <% echo "${real_chan2ghz} / ${real_chan5ghz}" %> | Hood:  <% echo "${chan2ghz} / ${chan5ghz}" %></td></tr>
> > +		<tr><th style="width:200px">SSID (Client-AP):</th><td>Gerät: <% echo "${real_essid}" %> | Hood:  <% echo "${essid}" %></td></tr>
> >  		<tr><td colspan="2"> </td></tr>
> >  		<tr><td colspan="2">Beim Klicken werden die Hood-Daten innerhalb von 5 Minuten neu abgerufen und angewandt:</td></tr>
> >  		<tr><td colspan="2"><input type="submit" name="resethood" value="Reset hood data" /></td></tr>
> >  	</table>
> >  </fieldset>
> >  </form>
> > -</td></tr>
> > -<tr><td>
> > -<fieldset style="min-height: 12.65em;">
> > -	<legend>Netz: Freifunk</legend>
> > -	<table>
> > -		<tr><th>Nutzer:</th><td><% cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W' %></td></tr>
> > -		<tr><th>Empfangen:</th><td><% cat /sys/class/net/br-mesh/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
> > -		<tr><th>Gesendet:</th><td><% cat /sys/class/net/br-mesh/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
> > -		<tr><th>IPv4 Adressen:</th><td><% addr 4 br-mesh %></td></tr>
> > -		<tr><th>IPv6 Adressen:</th><td><% addr 6 br-mesh %></td></tr>
> > -	</table>
> > -</fieldset>
> > -</td><td>
> > -<fieldset style="min-height: 12.65em;">
> > +<fieldset style="padding-bottom:12px">
> >  	<legend>Netz: WAN</legend>
> >  	<table>
> >  		<tr><th>Internet vorhanden:</th><td><%= ${internet_active} %></td></tr>
> > -- 
> > 2.7.4
> > 
> 
> -- 
> franken-dev mailing list
> franken-dev at freifunk.net
> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 473 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171112/b5194456/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev