bandwidth fields
This commit is contained in:
parent
fefdb69763
commit
224addc2b3
|
@ -2,3 +2,6 @@
|
||||||
config wizard
|
config wizard
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
|
|
||||||
|
config bandwidth
|
||||||
|
option upstream 0
|
||||||
|
option downstream 0
|
||||||
|
|
|
@ -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.default = string.format("%d", uci:get("fastd", "ffhl_mesh_vpn", "enabled"))
|
||||||
meshvpn.rmempty = false
|
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)
|
function f.handle(self, state, data)
|
||||||
if state == FORM_VALID then
|
if state == FORM_VALID then
|
||||||
local stat = false
|
local stat = false
|
||||||
uci:set("fastd", "ffhl_mesh_vpn", "enabled", data.meshvpn)
|
uci:set("fastd", "ffhl_mesh_vpn", "enabled", data.meshvpn)
|
||||||
uci:save("fastd")
|
uci:save("fastd")
|
||||||
uci:commit("fastd")
|
uci:commit("fastd")
|
||||||
|
|
||||||
|
uci:set("ffhl", "bandwidth", "upstream", data.upstream)
|
||||||
|
uci:set("ffhl", "bandwidth", "downstream", data.downstream)
|
||||||
|
|
||||||
if data.meshvpn == "1" then
|
if data.meshvpn == "1" then
|
||||||
local secret = uci:get("fastd", "ffhl_mesh_vpn", "secret")
|
local secret = uci:get("fastd", "ffhl_mesh_vpn", "secret")
|
||||||
|
|
Loading…
Reference in New Issue