applications/luci-olsr: If InterfaceDefaults are set for a value and it is unset in the interface section then show the value from InterfaceDefaults instead of the olsrd default value. This aims to fix #175
This commit is contained in:
parent
99881d9cb6
commit
725c424a75
1 changed files with 9 additions and 9 deletions
|
@ -307,34 +307,34 @@ network.template = "cbi/network_netinfo"
|
||||||
|
|
||||||
mode = ifs:option(DummyValue, "Mode", translate("Mode"))
|
mode = ifs:option(DummyValue, "Mode", translate("Mode"))
|
||||||
function mode.cfgvalue(...)
|
function mode.cfgvalue(...)
|
||||||
return Value.cfgvalue(...) or "mesh"
|
return Value.cfgvalue(...) or m.uci:get_first("olsrd", "InterfaceDefaults", "Mode", "mesh")
|
||||||
end
|
end
|
||||||
|
|
||||||
hello = ifs:option(DummyValue, "_hello", translate("Hello"))
|
hello = ifs:option(DummyValue, "_hello", translate("Hello"))
|
||||||
function hello.cfgvalue(self, section)
|
function hello.cfgvalue(self, section)
|
||||||
local i = tonumber(m.uci:get("olsrd", section, "HelloInterval")) or 5
|
local i = tonumber(m.uci:get("olsrd", section, "HelloInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HelloInterval", 5))
|
||||||
local v = tonumber(m.uci:get("olsrd", section, "HelloValidityTime")) or 40
|
local v = tonumber(m.uci:get("olsrd", section, "HelloValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HelloValidityTime", 40))
|
||||||
return "%.01fs / %.01fs" %{ i, v }
|
return "%.01fs / %.01fs" %{ i, v }
|
||||||
end
|
end
|
||||||
|
|
||||||
tc = ifs:option(DummyValue, "_tc", translate("TC"))
|
tc = ifs:option(DummyValue, "_tc", translate("TC"))
|
||||||
function tc.cfgvalue(self, section)
|
function tc.cfgvalue(self, section)
|
||||||
local i = tonumber(m.uci:get("olsrd", section, "TcInterval")) or 2
|
local i = tonumber(m.uci:get("olsrd", section, "TcInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "TcInterval", 2))
|
||||||
local v = tonumber(m.uci:get("olsrd", section, "TcValidityTime")) or 256
|
local v = tonumber(m.uci:get("olsrd", section, "TcValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "TcValidityTime", 256))
|
||||||
return "%.01fs / %.01fs" %{ i, v }
|
return "%.01fs / %.01fs" %{ i, v }
|
||||||
end
|
end
|
||||||
|
|
||||||
mid = ifs:option(DummyValue, "_mid", translate("MID"))
|
mid = ifs:option(DummyValue, "_mid", translate("MID"))
|
||||||
function mid.cfgvalue(self, section)
|
function mid.cfgvalue(self, section)
|
||||||
local i = tonumber(m.uci:get("olsrd", section, "MidInterval")) or 18
|
local i = tonumber(m.uci:get("olsrd", section, "MidInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "MidInterval", 18))
|
||||||
local v = tonumber(m.uci:get("olsrd", section, "MidValidityTime")) or 324
|
local v = tonumber(m.uci:get("olsrd", section, "MidValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "MidValidityTime", 324))
|
||||||
return "%.01fs / %.01fs" %{ i, v }
|
return "%.01fs / %.01fs" %{ i, v }
|
||||||
end
|
end
|
||||||
|
|
||||||
hna = ifs:option(DummyValue, "_hna", translate("HNA"))
|
hna = ifs:option(DummyValue, "_hna", translate("HNA"))
|
||||||
function hna.cfgvalue(self, section)
|
function hna.cfgvalue(self, section)
|
||||||
local i = tonumber(m.uci:get("olsrd", section, "HnaInterval")) or 18
|
local i = tonumber(m.uci:get("olsrd", section, "HnaInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HnaInterval", 18))
|
||||||
local v = tonumber(m.uci:get("olsrd", section, "HnaValidityTime")) or 108
|
local v = tonumber(m.uci:get("olsrd", section, "HnaValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HnaValidityTime", 108))
|
||||||
return "%.01fs / %.01fs" %{ i, v }
|
return "%.01fs / %.01fs" %{ i, v }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue