summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua')
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
index 22dec5ee6..f4b6b2a92 100644
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
+++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
@@ -72,7 +72,9 @@ function s.parse(self, ...)
end
end
-ft.opt_name(s, DummyValue, translate("Name"))
+function s.sectiontitle(self, sid)
+ return (self.map:get(sid, "name") or translate("Unnamed rule"))
+end
local function rule_proto_txt(self, s)
local f = self.map:get(s, "family")
@@ -159,7 +161,6 @@ 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),
@@ -170,7 +171,6 @@ end
target = s:option(DummyValue, "target", translate("Action"))
target.rawhtml = true
-target.width = "20%"
function target.cfgvalue(self, s)
local t = ft.fmt_target(self.map:get(s, "target"), self.map:get(s, "src"), self.map:get(s, "dest"))
local l = ft.fmt_limit(self.map:get(s, "limit"),
@@ -183,7 +183,7 @@ function target.cfgvalue(self, s)
end
end
-ft.opt_enabled(s, Flag, translate("Enable")).width = "1%"
+ft.opt_enabled(s, Flag, translate("Enable"))
--
@@ -240,11 +240,12 @@ function s.filter(self, sid)
return (self.map:get(sid, "target") == "SNAT")
end
-ft.opt_name(s, DummyValue, translate("Name"))
+function s.sectiontitle(self, sid)
+ return (self.map:get(sid, "name") or translate("Unnamed SNAT"))
+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),
@@ -255,7 +256,6 @@ end
snat = s:option(DummyValue, "via", translate("Action"))
snat.rawhtml = true
-snat.width = "20%"
function snat.cfgvalue(self, s)
local a = ft.fmt_ip(self.map:get(s, "src_dip"))
local p = ft.fmt_port(self.map:get(s, "src_dport"))
@@ -267,7 +267,7 @@ function snat.cfgvalue(self, s)
end
end
-ft.opt_enabled(s, Flag, translate("Enable")).width = "1%"
+ft.opt_enabled(s, Flag, translate("Enable"))
return m