add tc disable field
This commit is contained in:
parent
7ce4cf07f6
commit
44e3850193
|
@ -9,6 +9,12 @@ meshvpn = f:field(Flag, "meshvpn", "Mesh-VPN aktivieren?")
|
|||
meshvpn.default = string.format("%d", uci:get("fastd", "ffhl_mesh_vpn", "enabled"))
|
||||
meshvpn.rmempty = false
|
||||
|
||||
tc = f:field(Flag, "tc", "Bandbreitenbegrenzung aktivieren?")
|
||||
local v = string.format("%d", uci:get_first("ffhl", "bandwidth", "disabled"))
|
||||
if v == "1" then v = "0" else v = "1" end
|
||||
tc.default = v
|
||||
tc.rmempty = false
|
||||
|
||||
upstream = f:field(Value, "upstream", "Upstream bandwidth (kbit/s)")
|
||||
upstream.value = uci:get_first("ffhl", "bandwidth", "upstream")
|
||||
downstream = f:field(Value, "downstream", "Downstream bandwidth (kbit/s)")
|
||||
|
@ -21,9 +27,13 @@ function f.handle(self, state, data)
|
|||
uci:save("fastd")
|
||||
uci:commit("fastd")
|
||||
|
||||
local v = string.format("%d", data.tc)
|
||||
if v == "1" then v = "0" else v = "1" end
|
||||
|
||||
uci:foreach("ffhl", "bandwidth", function(s)
|
||||
uci:set("ffhl", s[".name"], "upstream", data.upstream)
|
||||
uci:set("ffhl", s[".name"], "downstream", data.downstream)
|
||||
uci:set("ffhl", s[".name"], "disabled", v)
|
||||
end
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue