Compare commits

...

2 Commits

Author SHA1 Message Date
Christian Dresel da50954db7 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>
2020-12-12 21:14:42 +01:00
Adrian Schmutzler d4e6482b60 fff-web: remove included files from HTTP-accessible folder
Certain files are only included, but are not meant to be accessed
via HTTP directly. Move those to a dedicated directory that is not
served via HTTP.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
2020-12-12 21:12:35 +01:00
19 changed files with 38 additions and 36 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web
PKG_RELEASE:=11
PKG_RELEASE:=13
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -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&uuml;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>

View File

@ -0,0 +1 @@
home,Home

View File

@ -0,0 +1 @@
settings,Einstellungen

View File

@ -0,0 +1 @@
ports,Anschl&uuml;sse

View File

@ -0,0 +1 @@
wifiscan,Wifi Scan

View File

@ -0,0 +1 @@
upgrade,Upgrade

View File

@ -0,0 +1 @@
password,Passwort

View File

@ -0,0 +1 @@
reboot,Neustart

View File

@ -0,0 +1 @@
logout,Logout

View File

@ -13,8 +13,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
fi
fi
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<%
if pidof fastd >/dev/null ; then
@ -116,4 +116,4 @@ fi
</td></tr>
</table>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>

View File

@ -20,8 +20,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
fi
fi
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<form method="POST">
<input type="text" name="username" value="root" style="display: none;" />
@ -43,7 +43,7 @@ fi
</table>
<input type="submit" style="margin-top: 5px; margin-left: 3px;" />
</form>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>
<%
#force instant password change
if [ "$restart_uhttpd" = "1" ] ; then

View File

@ -71,8 +71,8 @@ format_port() {
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<form method="post">
<table style="width: 100%;">
@ -237,7 +237,7 @@ format_port() {
<% fi %>
</table>
</form>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>
<%
# write
if [ "$do_reboot" = "1" ] ; then

View File

@ -9,8 +9,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
fi
fi
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<form method="POST">
<table style="width: 100%;">
@ -26,7 +26,7 @@ fi
</td></tr>
</table>
</form>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>
<%
# write
if [ "$do_reboot" = "1" ] ; then

View File

@ -65,8 +65,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
fi
fi
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<%
# read
chkd='checked="checked" '
@ -154,4 +154,4 @@ fi
</td></tr>
</table>
</form>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>

View File

@ -29,8 +29,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
fi
fi
%>
<%in /www/ssl/cgi-bin/header %>
<%in /www/ssl/cgi-bin/helpers %>
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<form method="post" enctype="multipart/form-data">
<table style="width: 100%;">
@ -60,7 +60,7 @@ fi
</td></tr>
</table>
</form>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>
<%
# write
if [ "$do_reset" = "1" ] ; then

View File

@ -1,6 +1,6 @@
#!/usr/bin/haserl
<%in /www/ssl/cgi-bin/header %>
<%in /www/include/header %>
<table style="width: 100%">
<tr><td>
<fieldset>
@ -23,4 +23,4 @@ iw dev w2mesh scan | sed 's/^BSS/\nBSS/g' |\
</td></tr>
</table>
<%in /www/ssl/cgi-bin/footer %>
<%in /www/include/footer %>