Message ID | 20201211102818.823822-1-freifunk@dresel.systems |
---|---|
State | Superseded |
Headers | show |
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/01-home.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/01-home.men new file mode 100644 index 0000000..8a84e1f --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/01-home.men @@ -0,0 +1 @@ +home,Home diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/10-settings.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/10-settings.men new file mode 100644 index 0000000..afc4a7a --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/10-settings.men @@ -0,0 +1 @@ +settings,Einstellungen diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/20-ports.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/20-ports.men new file mode 100644 index 0000000..44bb8fb --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/20-ports.men @@ -0,0 +1 @@ +ports,Anschluesse diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/30-wifiscan.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/30-wifiscan.men new file mode 100644 index 0000000..844faa6 --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/30-wifiscan.men @@ -0,0 +1 @@ +wifiscan,Wifi Scan diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/40-upgrade.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/40-upgrade.men new file mode 100644 index 0000000..f31aa1b --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/40-upgrade.men @@ -0,0 +1 @@ +upgrade,Upgrade diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/50-password.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/50-password.men new file mode 100644 index 0000000..16246d6 --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/50-password.men @@ -0,0 +1 @@ +password,Passwort diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/60-reboot.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/60-reboot.men new file mode 100644 index 0000000..c910310 --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/60-reboot.men @@ -0,0 +1 @@ +reboot,Neustart diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/70-logout.men b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/70-logout.men new file mode 100644 index 0000000..3a5843e --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/70-logout.men @@ -0,0 +1 @@ +logout,Ausloggen diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header index 84e259f..cbecde3 100755 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header @@ -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,18 @@ 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/ssl/cgi-bin/*.men; do + var=$(cat $f); + link=$(echo $var | cut -d "," -f 1) + name=$(echo $var | cut -d "," -f 2) + script_file="/cgi-bin/$link.html"; + if [ "$script_file" = "$REQUEST_URI" ] ; + then + class_active=' class="active"' + fi + echo -ne "\t<li$class_active><a href=\""$link".html\">$name</a></li>\n\t\t"; + class_active="" + done %> </ul> <div></div>
To add new menu items in other packages we need a modular construction: - Simpel Babelweb - Layer 3 configuration and so on Every new menu item need a *.men file with information: link,name link is the name of the html file without html name is the name of the link in the webui Signed-off-by: Christian Dresel <freifunk@dresel.systems> --- .../fff-web/files/www/ssl/cgi-bin/01-home.men | 1 + .../files/www/ssl/cgi-bin/10-settings.men | 1 + .../files/www/ssl/cgi-bin/20-ports.men | 1 + .../files/www/ssl/cgi-bin/30-wifiscan.men | 1 + .../files/www/ssl/cgi-bin/40-upgrade.men | 1 + .../files/www/ssl/cgi-bin/50-password.men | 1 + .../files/www/ssl/cgi-bin/60-reboot.men | 1 + .../files/www/ssl/cgi-bin/70-logout.men | 1 + .../fff/fff-web/files/www/ssl/cgi-bin/header | 27 +++++++++---------- 9 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/01-home.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/10-settings.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/20-ports.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/30-wifiscan.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/40-upgrade.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/50-password.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/60-reboot.men create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/70-logout.men