X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-radvd%2Fluasrc%2Fmodel%2Fcbi%2Fradvd%2Fprefix.lua;h=6151910649f816eb8a79ba511fb45c18f6573941;hp=460a244d03acab9ecd9338abcc4015e5d1ca1fa0;hb=a707d2cb84459d8f92eebadec86eeefb16c0548e;hpb=a2eefbab4d1ba7bc2aa1779fa8f83616c3c9a209 diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua index 460a244d0..615191064 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local sid = arg[1] +local utl = require "luci.util" m = Map("radvd", translatef("Radvd - Prefix"), translate("Radvd is a router advertisement daemon for IPv6. " .. @@ -38,6 +39,19 @@ s:tab("advanced", translate("Advanced")) -- General -- +o = s:taboption("general", Flag, "ignore", translate("Enable")) +o.rmempty = false + +function o.cfgvalue(...) + local v = Flag.cfgvalue(...) + return v == "1" and "0" or "1" +end + +function o.write(self, section, value) + Flag.write(self, section, value == "1" and "0" or "1") +end + + o = s:taboption("general", Value, "interface", translate("Interface"), translate("Specifies the logical interface name this section belongs to")) @@ -62,11 +76,20 @@ function o.write(self, section, value) end -o = s:taboption("general", Value, "prefix", translate("Prefix"), - translate("Advertised IPv6 prefix. If empty, the current interface prefix is used")) +o = s:taboption("general", DynamicList, "prefix", translate("Prefixes"), + translate("Advertised IPv6 prefixes. If empty, the current interface prefix is used")) -o.optional = true -o.datatype = "ip6addr" +o.optional = true +o.datatype = "ip6addr" +o.placeholder = translate("default") +function o.cfgvalue(self, section) + local l = { } + local v = m.uci:get_list("radvd", section, "prefix") + for v in utl.imatch(v) do + l[#l+1] = v + end + return l +end o = s:taboption("general", Flag, "AdvOnLink", translate("On-link determination"),