-proto = s:option(DummyValue, "proto", translate("Protocol"))
-proto.rawhtml = true
-function proto.cfgvalue(self, s)
- return ft.fmt_proto(self.map:get(s, "proto")) or "TCP+UDP"
-end
-
-
-src = s:option(DummyValue, "src", translate("Source"))
-src.rawhtml = true
-src.width = "20%"
-function src.cfgvalue(self, s)
- local z = ft.fmt_zone(self.map:get(s, "src"), translate("any zone"))
- local a = ft.fmt_ip(self.map:get(s, "src_ip"), translate("any host"))
- local p = ft.fmt_port(self.map:get(s, "src_port"))
- local m = ft.fmt_mac(self.map:get(s, "src_mac"))
-
- if p and m then
- return translatef("From %s in %s with source %s and %s", a, z, p, m)
- elseif p or m then
- return translatef("From %s in %s with source %s", a, z, p or m)
- else
- return translatef("From %s in %s", a, z)
- end
-end
-
-dest = s:option(DummyValue, "dest", translate("Destination"))
-dest.rawhtml = true
-dest.width = "30%"
-function dest.cfgvalue(self, s)
- local z = ft.fmt_zone(self.map:get(s, "dest"), translate("any zone"))
- local a = ft.fmt_ip(self.map:get(s, "dest_ip"), translate("any host"))
- local p = ft.fmt_port(self.map:get(s, "dest_port")) or
- ft.fmt_port(self.map:get(s, "src_dport"))
-
- if p then
- return translatef("To %s, %s in %s", a, p, z)
- else
- return translatef("To %s in %s", a, z)
- end
+match = s:option(DummyValue, "match", translate("Match"))
+match.rawhtml = true
+match.width = "70%"
+function match.cfgvalue(self, s)
+ return "<small>%s<br />%s<br />%s</small>" % {
+ rule_proto_txt(self, s),
+ rule_src_txt(self, s),
+ snat_dest_txt(self, s)
+ }