diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-04-15 14:31:12 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-04-15 14:31:12 +0000 |
commit | 4f9363d70091bfb1883b1f6ab913554c02cbbad2 (patch) | |
tree | 0c8566f15bcce78ece411cddfdab8e32ec1bc113 /applications/luci-radvd | |
parent | fd28386e35a947cf9966ae6fd8d2dd5673279bad (diff) |
applications/luci-radvd: allow the special value "infinity" for preferred lifetime options, resync translation
Diffstat (limited to 'applications/luci-radvd')
4 files changed, 10 insertions, 95 deletions
diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/dnssl.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/dnssl.lua index fe17f0c28..ec67f308a 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/dnssl.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/dnssl.lua @@ -90,27 +90,10 @@ end o = s:option(Value, "AdvDNSSLLifetime", translate("Lifetime"), - translate("Specifies the maximum duration how long the DNSSL entries are used for name resolution. Use 0 to specify an infinite lifetime")) + translate("Specifies the maximum duration how long the DNSSL entries are used for name resolution.")) -o.datatype = "uinteger" +o.datatype = 'or(uinteger,"infinity")' o.placeholder = 1200 -function o.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - if v == "infinity" then - return 0 - else - return v - end -end - -function o.write(self, section, value) - if value == "0" then - Value.write(self, section, "infinity") - else - Value.write(self, section, value) - end -end - return m diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua index 615191064..603298651 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua @@ -115,52 +115,18 @@ o = s:taboption("advanced", Flag, "AdvRouterAddr", translate("Advertise router a o = s:taboption("advanced", Value, "AdvValidLifetime", translate("Valid lifetime"), - translate("Advertises the length of time in seconds that the prefix is valid for the purpose of on-link determination. Use 0 to specify an infinite lifetime")) + translate("Advertises the length of time in seconds that the prefix is valid for the purpose of on-link determination.")) -o.datatype = "uinteger" +o.datatype = 'or(uinteger,"infinity")' o.placeholder = 86400 -function o.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - if v == "infinity" then - return 0 - else - return v - end -end - -function o.write(self, section, value) - if value == "0" then - Value.write(self, section, "infinity") - else - Value.write(self, section, value) - end -end - o = s:taboption("advanced", Value, "AdvPreferredLifetime", translate("Preferred lifetime"), - translate("Advertises the length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred. Use 0 to specify an infinite lifetime")) + translate("Advertises the length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred.")) -o.datatype = "uinteger" +o.datatype = 'or(uinteger,"infinity")' o.placeholder = 14400 -function o.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - if v == "infinity" then - return 0 - else - return v - end -end - -function o.write(self, section, value) - if value == "0" then - Value.write(self, section, "infinity") - else - Value.write(self, section, value) - end -end - o = s:taboption("advanced", Value, "Base6to4Interface", translate("6to4 interface"), translate("Specifies a logical interface name to derive a 6to4 prefix from. The interfaces public IPv4 address is combined with 2002::/3 and the value of the prefix option")) diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua index b9704cdb4..ea6526399 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua @@ -91,27 +91,10 @@ end o = s:option(Value, "AdvRDNSSLifetime", translate("Lifetime"), - translate("Specifies the maximum duration how long the RDNSS entries are used for name resolution. Use 0 to specify an infinite lifetime")) + translate("Specifies the maximum duration how long the RDNSS entries are used for name resolution.")) -o.datatype = "uinteger" +o.datatype = 'or(uinteger,"infinity")' o.placeholder = 1200 -function o.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - if v == "infinity" then - return 0 - else - return v - end -end - -function o.write(self, section, value) - if value == "0" then - Value.write(self, section, "infinity") - else - Value.write(self, section, value) - end -end - return m diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua index 37fac576b..97c72a4ec 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua @@ -90,28 +90,11 @@ end o = s:option(Value, "AdvRouteLifetime", translate("Lifetime"), - translate("Specifies the lifetime associated with the route in seconds. Use 0 to specify an infinite lifetime")) + translate("Specifies the lifetime associated with the route in seconds.")) -o.datatype = "uinteger" +o.datatype = 'or(uinteger,"infinity")' o.placeholder = 1800 -function o.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - if v == "infinity" then - return 0 - else - return v - end -end - -function o.write(self, section, value) - if value == "0" then - Value.write(self, section, "infinity") - else - Value.write(self, section, value) - end -end - o = s:option(ListValue, "AdvRoutePreference", translate("Preference"), translate("Specifies the preference associated with the default router")) |