bandwidth fields

This commit is contained in:
Nils Schneider 2012-07-23 22:04:08 +02:00 committed by Matthias Schiffer
parent fefdb69763
commit 224addc2b3
2 changed files with 11 additions and 0 deletions

View File

@ -2,3 +2,6 @@
config wizard
option enabled '1'
config bandwidth
option upstream 0
option downstream 0

View File

@ -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")