diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-06-19 17:53:20 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-06-22 11:15:39 +0200 |
commit | 5142e40f9e70a09653e07a4dbc2abd6db3da36e4 (patch) | |
tree | fdc89da71911f72820e3d6d9fa7a1d80a9909596 /applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua | |
parent | 69782ccbccd67bac08f43b692c2a05afddb41bf0 (diff) |
luci-app-firewall: update cbi models
- allow multiple src/dest ips for rules (#1637)
- restrict ICMP type list to ICMP protocol
- add section title callbacks
- remove size annotations
- fix validation error with aliased zone fields (#1882)
Fixes #1637, #1882.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua')
-rw-r--r-- | applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua index 5485ebf096..5d1ffe0913 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua @@ -63,8 +63,9 @@ 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 forward")) +end local function forward_proto_txt(self, s) @@ -103,7 +104,6 @@ end match = s:option(DummyValue, "match", translate("Match")) match.rawhtml = true -match.width = "50%" function match.cfgvalue(self, s) return "<small>%s<br />%s<br />%s</small>" % { forward_proto_txt(self, s), @@ -115,7 +115,6 @@ end dest = s:option(DummyValue, "dest", translate("Forward to")) dest.rawhtml = true -dest.width = "40%" 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")) @@ -129,6 +128,6 @@ function dest.cfgvalue(self, s) end end -ft.opt_enabled(s, Flag, translate("Enable")).width = "1%" +ft.opt_enabled(s, Flag, translate("Enable")) return m |