forked from freifunk-franken/firmware
fff-web: Make ssl menu modular
To add new menu items in other packages we need a modular construction: - Simpel Babelweb - Layer 3 configuration and so on Every menu item needs a file in /www/menu/ssl/ with the content link,name - link is the name of the html file without extension (.html) - name is the text of the link in the webui While at it, rename "Password" menu item to German "Passwort". Signed-off-by: Christian Dresel <freifunk@dresel.systems> [bump PKG_RELEASE, use /www/menu, use script_file for link, improve use of class_active, commit message adjustments, improve variable names, keep HTML umlaut, keep Logout] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
d4e6482b60
commit
da50954db7
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-web
|
||||
PKG_RELEASE:=12
|
||||
PKG_RELEASE:=13
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
|
|
@ -7,13 +7,6 @@
|
|||
UPGRADE_PATH="$(getUpgradePath)"
|
||||
|
||||
echo -en "Content-Type: text/html\r\n\r\n"
|
||||
nav_entry() {
|
||||
script_file="/cgi-bin/$1"
|
||||
if [ "$script_file" = "$REQUEST_URI" ] ; then
|
||||
local class_active=' class="active"'
|
||||
fi
|
||||
echo -ne "\t<li${class_active}><a href=\"${script_file}\">$2</a></li>\n\t\t"
|
||||
}
|
||||
|
||||
HOSTNAME="$(uci -q get "fff.system.hostname")"
|
||||
hood="$(uci -q get "system.@system[0].hood")"
|
||||
|
@ -52,14 +45,15 @@ fi
|
|||
<div id="menu">
|
||||
<ul>
|
||||
<%
|
||||
nav_entry home.html "Home"
|
||||
nav_entry settings.html "Einstellungen"
|
||||
nav_entry ports.html "Anschlüsse"
|
||||
nav_entry wifiscan.html "Wifi Scan"
|
||||
nav_entry upgrade.html "Upgrade"
|
||||
nav_entry password.html "Password"
|
||||
nav_entry reboot.html "Neustart"
|
||||
nav_entry logout.html "Logout"
|
||||
for f in /www/menu/ssl/*; do
|
||||
var=$(cat $f);
|
||||
menu_file=$(echo $var | cut -d "," -f 1)
|
||||
menu_name=$(echo $var | cut -d "," -f 2)
|
||||
menu_link="/cgi-bin/${menu_file}.html";
|
||||
class_active=""
|
||||
[ "$menu_link" = "$REQUEST_URI" ] && class_active=' class="active"'
|
||||
echo -ne "\t<li$class_active><a href=\"${menu_link}\">$menu_name</a></li>\n\t\t";
|
||||
done
|
||||
%>
|
||||
</ul>
|
||||
<div></div>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
home,Home
|
|
@ -0,0 +1 @@
|
|||
settings,Einstellungen
|
|
@ -0,0 +1 @@
|
|||
ports,Anschlüsse
|
|
@ -0,0 +1 @@
|
|||
wifiscan,Wifi Scan
|
|
@ -0,0 +1 @@
|
|||
upgrade,Upgrade
|
|
@ -0,0 +1 @@
|
|||
password,Passwort
|
|
@ -0,0 +1 @@
|
|||
reboot,Neustart
|
|
@ -0,0 +1 @@
|
|||
logout,Logout
|
Loading…
Reference in New Issue