bandwidth fields
This commit is contained in:
parent
fefdb69763
commit
224addc2b3
|
@ -2,3 +2,6 @@
|
|||
config wizard
|
||||
option enabled '1'
|
||||
|
||||
config bandwidth
|
||||
option upstream 0
|
||||
option downstream 0
|
||||
|
|
|
@ -9,6 +9,11 @@ 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
|
||||
|
@ -16,6 +21,9 @@ function f.handle(self, state, data)
|
|||
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")
|
||||
if not secret or not secret:match("%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x") then
|
||||
|
|
Loading…
Reference in New Issue