diff --git a/luci/config-mode/files/etc/config/ffhl b/luci/config-mode/files/etc/config/ffhl index 5993307..614978e 100644 --- a/luci/config-mode/files/etc/config/ffhl +++ b/luci/config-mode/files/etc/config/ffhl @@ -2,3 +2,6 @@ config wizard option enabled '1' +config bandwidth + option upstream 0 + option downstream 0 diff --git a/luci/config-mode/files/usr/lib/lua/luci/model/cbi/ffhl-wizard/meshvpn.lua b/luci/config-mode/files/usr/lib/lua/luci/model/cbi/ffhl-wizard/meshvpn.lua index 6bd76d6..eb59cab 100644 --- a/luci/config-mode/files/usr/lib/lua/luci/model/cbi/ffhl-wizard/meshvpn.lua +++ b/luci/config-mode/files/usr/lib/lua/luci/model/cbi/ffhl-wizard/meshvpn.lua @@ -9,12 +9,20 @@ meshvpn = f:field(Flag, "meshvpn", "Mesh-VPN aktivieren?") meshvpn.default = string.format("%d", uci:get("fastd", "ffhl_mesh_vpn", "enabled")) meshvpn.rmempty = false +upstream = f:field(Value, "upstream", "Upstream bandwidth (kbit/s)") +upstream.default = uci:get("ffhl", "bandwidth", "upstream") +downstream = f:field(Value, "dowstream", "Downstream bandwidth (kbit/s)") +downstream.default = uci:get("ffhl", "bandwidth", "downstream") + function f.handle(self, state, data) if state == FORM_VALID then local stat = false uci:set("fastd", "ffhl_mesh_vpn", "enabled", data.meshvpn) uci:save("fastd") uci:commit("fastd") + + uci:set("ffhl", "bandwidth", "upstream", data.upstream) + uci:set("ffhl", "bandwidth", "downstream", data.downstream) if data.meshvpn == "1" then local secret = uci:get("fastd", "ffhl_mesh_vpn", "secret")