X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-fw%2Fluasrc%2Fmodel%2Fcbi%2Fluci_fw%2Ftrule.lua;h=c7aab0f5bba5784f70dd21021e897161a77e1e39;hb=25d9dc415f05bb8e535ccf3d4f3abdf67d2d9e72;hp=3712196ff856017b2b426bef6503589c835b1d1b;hpb=1e10c4ae4a6a43ca0a2ea07c2b4cf95fce66cc7d;p=project%2Fluci.git diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua index 3712196ff..c7aab0f5b 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua @@ -16,16 +16,22 @@ m = Map("firewall", translate("firewall_rule"), translate("firewall_rule_desc")) s = m:section(NamedSection, arg[1], "rule", "") s.anonymous = true +s.addremove = false + +back = s:option(DummyValue, "_overview", translate("overview")) +back.value = "" +back.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "rule") + name = s:option(Value, "_name", translate("name")..translate("cbi_optional")) name.rmempty = true -iface = s:option(ListValue, "src", translate("firewall_rule_src")) +iface = s:option(ListValue, "src", translate("fw_src")) iface.rmempty = true -oface = s:option(ListValue, "dest", translate("firewall_rule_dest")) -oface:value("") -oface.optional = true +oface = s:option(ListValue, "dest", translate("fw_dest")) +oface:value("", translate("device", "device")) +oface.rmempty = true luci.model.uci.cursor():foreach("firewall", "zone", function (section) @@ -33,7 +39,7 @@ luci.model.uci.cursor():foreach("firewall", "zone", oface:value(section.name) end) -proto = s:option(ListValue, "proto", translate("protocol")) +proto = s:option(Value, "proto", translate("protocol")) proto.optional = true proto:value("") proto:value("tcpudp", "TCP+UDP") @@ -46,13 +52,11 @@ s:option(Value, "dest_ip", translate("firewall_rule_destip")).optional = true s:option(Value, "src_mac", translate("firewall_rule_srcmac")).optional = true sport = s:option(Value, "src_port", translate("firewall_rule_srcport")) -sport.optional = true sport:depends("proto", "tcp") sport:depends("proto", "udp") sport:depends("proto", "tcpudp") dport = s:option(Value, "dest_port", translate("firewall_rule_destport")) -dport.optional = true dport:depends("proto", "tcp") dport:depends("proto", "udp") dport:depends("proto", "tcpudp")