forked from freifunk-franken/firmware
Add package fff-web-autol3
With this package, the autol3 configuration can make over the webui Signed-off-by: Christian Dresel <freifunk@dresel.systems> sq
This commit is contained in:
parent
5f22c2131c
commit
e50cb9d7d9
|
@ -19,6 +19,7 @@ define Package/fff-layer3
|
|||
+fff-layer3-config \
|
||||
+fff-network \
|
||||
+fff-ra \
|
||||
+fff-web-autol3 \
|
||||
+fff-wireguard \
|
||||
+arptables \
|
||||
+bmon \
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-web-autol3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web-autol3
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-web-autol3
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
TITLE:=Freifunk-Franken layer3 autol3 webui
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:= \
|
||||
+fff-autol3 \
|
||||
+fff-web-ui
|
||||
|
||||
endef
|
||||
|
||||
define Package/fff-web-autol3/description
|
||||
Webui for autol3
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
# nothing
|
||||
endef
|
||||
|
||||
define Package/fff-web-autol3/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-web-autol3))
|
|
@ -0,0 +1 @@
|
|||
autol3,Automatische Layer 3 Einstellungen
|
|
@ -0,0 +1,128 @@
|
|||
#!/usr/bin/haserl
|
||||
|
||||
<%in /www/include/header %>
|
||||
<%in /www/include/helpers %>
|
||||
<% show_msg %>
|
||||
|
||||
<%
|
||||
|
||||
if [ -n "${POST_save}" ] ; then
|
||||
if [ -n "${POST_autol3v4}" ] ; then
|
||||
uci set fff.autol3.ipv4=1
|
||||
else
|
||||
uci del fff.autol3.ipv4
|
||||
fi
|
||||
if [ -n "${POST_autol3v6}" ] ; then
|
||||
uci set fff.autol3.ipv6=1
|
||||
else
|
||||
uci del fff.autol3.ipv6
|
||||
fi
|
||||
uci commit fff
|
||||
fi
|
||||
if [ $(uci -q get fff.autol3.ipv6) ] ; then
|
||||
autol3v6="checked"
|
||||
fi
|
||||
if [ $(uci -q get fff.autol3.ipv4) ] ; then
|
||||
autol3v4="checked"
|
||||
fi
|
||||
ASSIGNER6OWN=$(uci -q get fff.autol3.ipv6assigner)
|
||||
IP6OWN=$(uci -q get fff.autol3.ipv6address)
|
||||
ASSIGNER4OWN=$(uci -q get fff.autol3.ipv4assigner)
|
||||
IP4OWN=$(uci -q get fff.autol3.ipv4address)
|
||||
|
||||
if [ -n "${POST_blockv6}" ] ; then
|
||||
uci add_list fff.autol3.ipv6assignerblock=$ASSIGNER6OWN
|
||||
uci commit fff
|
||||
fi
|
||||
if [ -n "${POST_blockv4}" ] ; then
|
||||
uci add_list fff.autol3.ipv4assignerblock=$ASSIGNER6OWN
|
||||
uci commit fff
|
||||
fi
|
||||
|
||||
if [ -n "${POST_reloadv4}" ] ; then
|
||||
uci del fff.autol3.ipv4address
|
||||
uci del fff.autol3.ipv4assigner
|
||||
uci commit fff
|
||||
autov4
|
||||
fi
|
||||
if [ -n "${POST_reloadv6}" ] ; then
|
||||
uci del fff.autol3.ipv6address
|
||||
uci del fff.autol3.ipv6assigner
|
||||
uci commit fff
|
||||
autov6
|
||||
fi
|
||||
|
||||
if [ -n "${POST_removev6block}" ] ; then
|
||||
uci del_list fff.autol3.ipv6assignerblock=${POST_blockv6}
|
||||
uci commit fff
|
||||
fi
|
||||
if [ -n "${POST_removev4block}" ] ; then
|
||||
uci del_list fff.autol3.ipv4assignerblock=${POST_blockv4}
|
||||
uci commit fff
|
||||
fi
|
||||
%>
|
||||
|
||||
<form method="post">
|
||||
|
||||
<fieldset style="min-height: 7em;" class="smallinput">
|
||||
<legend>AutoL3</legend>
|
||||
<table>
|
||||
<tr><th>IPv4 Adresse automatisch beziehen:</th><td><input type="checkbox" id="autol3v4" name="autol3v4" <%= $autol3v4 %>></td><td>Wenn du diesen Haken setzt, wird automatisch eine IPv4 Adresse bezogen und NAT aktiviert</td></tr>
|
||||
<tr><th>IPv6 Adresse automatisch beziehen:</th><td><input type="checkbox" id="autol3v6" name="autol3v6" <%= $autol3v6 %>></td><td>bla</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<input type="submit" value="speichern" name="save" style="margin-top: 5px; margin-left: 3px;" />
|
||||
</form>
|
||||
<form method="post">
|
||||
<table>
|
||||
<tr><td>
|
||||
<fieldset style="min-height: 7em;" class="smallinput">
|
||||
<legend>IPv6 Konfiguration</legend>
|
||||
<table>
|
||||
<tr><th>Assigner:</th><td><td><%= $ASSIGNER6OWN %></td></tr>
|
||||
<tr><th>IP-Adresse:</th><td></td><td><%= $IP6OWN %></td></tr>
|
||||
</table>
|
||||
<input type="submit" value="Konfiguration neu laden" name="reloadv6" style="margin-top: 5px; margin-left: 3px;" />
|
||||
<input type="submit" value="Aktuellen Assigner sperren" name="blockv6" style="margin-top: 5px; margin-left: 3px;" />
|
||||
</fieldset>
|
||||
</td><td>
|
||||
<fieldset style="min-height: 7em;" class="smallinput">
|
||||
<legend>IPv4 Konfiguration</legend>
|
||||
<table>
|
||||
<tr><th>Assigner:</th><td><td><%= $ASSIGNER4OWN %></td></tr>
|
||||
<tr><th>IP-Adresse:</th><td></td><td><%= $IP4OWN %></td></tr>
|
||||
</table>
|
||||
<input type="submit" value="Konfiguration neu laden" name="reloadv4" style="margin-top: 5px; margin-left: 3px;" />
|
||||
<input type="submit" value="Aktuellen Assigner sperren" name="blockv4" style="margin-top: 5px; margin-left: 3px;" />
|
||||
</fieldset>
|
||||
</td></tr>
|
||||
</form>
|
||||
<form method="post">
|
||||
<tr><td>
|
||||
<fieldset style="min-height: 7em;" class="smallinput">
|
||||
<legend>IPv6 Blockliste</legend>
|
||||
<table>
|
||||
<%
|
||||
ipv6assignerblock=$(uci get fff.autol3.ipv6assignerblock)
|
||||
for ipv6assignerblock in $ipv6assignerblock; do
|
||||
echo "<tr><td>"$ipv6assignerblock":</td><td><input type=\"hidden\" name=\"blockv6\" value=\"$ipv6assignerblock\" /><input type=\"submit\" value=\"entfernen\" name=\"removev6block\" style=\"margin-top: 5px; margin-left: 3px;\" /></td></tr>"
|
||||
done
|
||||
%>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td><td>
|
||||
<fieldset style="min-height: 7em;" class="smallinput">
|
||||
<legend>IPv4 Blockliste</legend>
|
||||
<table>
|
||||
<%
|
||||
ipv4assignerblock=$(uci get fff.autol3.ipv4assignerblock)
|
||||
for ipv4assignerblock in $ipv4assignerblock; do
|
||||
echo "<tr><td>"$ipv4assignerblock":</td><td><input type=\"hidden\" name=\"blockv4\" value=\"$ipv4assignerblock\" /><input type=\"submit\" value=\"entfernen\" name=\"removev4block\" style=\"margin-top: 5px; margin-left: 3px;\" /></td></tr>"
|
||||
done
|
||||
%>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<%in /www/include/footer %>
|
Loading…
Reference in New Issue