mirror of
https://github.com/freifunk-gluon/packages.git
synced 2024-06-15 19:54:07 +02:00
Reverse logic for tc enable option
This commit is contained in:
parent
39991b8000
commit
73039fe51b
|
@ -1,8 +1,7 @@
|
|||
|
||||
config wizard
|
||||
option enabled '1'
|
||||
|
||||
config bandwidth
|
||||
option upstream 0
|
||||
option downstream 0
|
||||
option disabled 1
|
||||
option upstream '0'
|
||||
option downstream '0'
|
||||
option enabled '0'
|
||||
|
|
|
@ -10,9 +10,7 @@ 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.default = string.format("%d", uci:get_first("ffhl", "bandwidth", "enabled"))
|
||||
tc.rmempty = false
|
||||
|
||||
upstream = f:field(Value, "upstream", "Upstream bandwidth (kbit/s)")
|
||||
|
@ -27,13 +25,10 @@ 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)
|
||||
uci:set("ffhl", s[".name"], "enabled", data.tc)
|
||||
end
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user