treewide: Split home.html in ssl-webui

We have different VPN or other things in the home.html of the ssl-webui

The patch split the files to the correct packages.

The layer3 file is a little bit smaller and need some work in feature to
add some informations (e.g. wireguard or babel information)

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2021-01-29 08:45:14 +01:00
parent e3954fddf5
commit 1e373481cf
5 changed files with 81 additions and 3 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-layer3
PKG_RELEASE:=8
PKG_RELEASE:=9
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,78 @@
#!/usr/bin/haserl
<%in /www/include/header %>
<%in /www/include/helpers %>
<% show_msg %>
<%
up="$(uptime)"
load="${up##*:}"
uptime="${up%%,*}"
uptime="${uptime##*up}"
#include OpenWrt version
. /etc/openwrt_release
. /etc/firmware_release
addr() {
local addr="$(ip -$1 address show dev $2 2>/dev/null | tr '/' ' '| awk '/inet/{ printf("%s<br />", $2); }')"
echo "${addr:--}"
}
default_gw() {
ip -$1 route list 0/0 dev $2 2> /dev/null | awk '{print($3); exit(0)}'
}
wanif=$(uci -q get network.wan.ifname)
if [ -n "$(default_gw 4 $wanif)" -o -n "$(default_gw 6 $wanif)" ]; then
internet_active="Ja"
else
internet_active="Nein"
fi
%>
<table style="width: 100%;">
<tr><td>
<fieldset style="padding-bottom:12px">
<legend>System</legend>
<table>
<tr><th>Name:</th><td><%= ${HOSTNAME} %></td></tr>
<tr><th>Modell:</th><td><% cat /tmp/sysinfo/model 2>/dev/null %></td></tr>
<tr><th>MAC-Adresse:</th><td><%= $(cat /sys/class/net/br-client/address) %></td></tr>
<tr><th>Laufzeit:</th><td><%= ${uptime} %></td></tr>
<tr><th>Auslastung:</th><td><%= ${load} %></td></tr>
<tr><th>Uhrzeit:</th><td><% date %></td></tr>
</table>
</fieldset>
<fieldset style="padding-bottom:12px">
<legend>Netz: Freifunk</legend>
<table>
<tr><th>Empfangen:</th><td><% cat /sys/class/net/br-client/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
<tr><th>Gesendet:</th><td><% cat /sys/class/net/br-client/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
<tr><th>IPv4 Adressen:</th><td><% addr 4 br-client %></td></tr>
<tr><th>IPv6 Adressen:</th><td><% addr 6 br-client %></td></tr>
</table>
</fieldset>
</td><td>
<fieldset style="padding-bottom:12px">
<legend>Software</legend>
<table>
<tr><th>Firmware Version:</th><td><%= ${FIRMWARE_VERSION} %></td></tr>
<tr><th>OpenWrt Version:</th><td><%= ${DISTRIB_DESCRIPTION} %></td></tr>
<tr><th>Kernel Version:</th><td><% uname -s -m -r %></td></tr>
</table>
</fieldset>
<form method="post">
</form>
<fieldset style="padding-bottom:12px">
<legend>Netz: WAN</legend>
<table>
<tr><th>Internet vorhanden:</th><td><%= ${internet_active} %></td></tr>
<tr><th>Empfangen:</th><td><% cat /sys/class/net/${wanif}/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
<tr><th>Gesendet:</th><td><% cat /sys/class/net/${wanif}/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
<tr><th>IPv4 Adressen:</th><td><% addr 4 $wanif %></td></tr>
<tr><th>IPv6 Adressen:</th><td><% addr 6 $wanif %></td></tr>
</table>
</fieldset>
</td></tr>
</table>
<%in /www/include/footer %>

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-node
PKG_RELEASE:=3
PKG_RELEASE:=4
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web-ui
PKG_RELEASE:=17
PKG_RELEASE:=18
include $(INCLUDE_DIR)/package.mk