X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-olsr%2Fluasrc%2Fmodel%2Fcbi%2Folsr%2Folsrd.lua;h=f7b173cd6f26f813de4a54566e99c89f0be43ba8;hp=9bc17c89596c2a845ebac9a3116d7573760863f9;hb=725c424a759ca55017a50947fa871b44c7a8b8ef;hpb=99881d9cb66c49c0011360d54e8c9c14d271a859 diff --git a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua index 9bc17c895..f7b173cd6 100644 --- a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua +++ b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua @@ -307,34 +307,34 @@ network.template = "cbi/network_netinfo" mode = ifs:option(DummyValue, "Mode", translate("Mode")) function mode.cfgvalue(...) - return Value.cfgvalue(...) or "mesh" + return Value.cfgvalue(...) or m.uci:get_first("olsrd", "InterfaceDefaults", "Mode", "mesh") end hello = ifs:option(DummyValue, "_hello", translate("Hello")) function hello.cfgvalue(self, section) - local i = tonumber(m.uci:get("olsrd", section, "HelloInterval")) or 5 - local v = tonumber(m.uci:get("olsrd", section, "HelloValidityTime")) or 40 + 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 tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HelloValidityTime", 40)) return "%.01fs / %.01fs" %{ i, v } end tc = ifs:option(DummyValue, "_tc", translate("TC")) function tc.cfgvalue(self, section) - local i = tonumber(m.uci:get("olsrd", section, "TcInterval")) or 2 - local v = tonumber(m.uci:get("olsrd", section, "TcValidityTime")) or 256 + 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 tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "TcValidityTime", 256)) return "%.01fs / %.01fs" %{ i, v } end mid = ifs:option(DummyValue, "_mid", translate("MID")) function mid.cfgvalue(self, section) - local i = tonumber(m.uci:get("olsrd", section, "MidInterval")) or 18 - local v = tonumber(m.uci:get("olsrd", section, "MidValidityTime")) or 324 + 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 tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "MidValidityTime", 324)) return "%.01fs / %.01fs" %{ i, v } end hna = ifs:option(DummyValue, "_hna", translate("HNA")) function hna.cfgvalue(self, section) - local i = tonumber(m.uci:get("olsrd", section, "HnaInterval")) or 18 - local v = tonumber(m.uci:get("olsrd", section, "HnaValidityTime")) or 108 + 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 tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HnaValidityTime", 108)) return "%.01fs / %.01fs" %{ i, v } end