From 33d41d469bea9777114978b589c306f22e0673b6 Mon Sep 17 00:00:00 2001 From: Jan Froch Date: Sat, 22 Feb 2025 02:19:49 +0100 Subject: [PATCH] luci-app-firewall: add log_limit This adds the 'log_limit' option to rules in Port Forwards and Traffic Rules. For NAT Rules this is not supported. Signed-off-by: Jan Froch --- .../htdocs/luci-static/resources/view/firewall/forwards.js | 5 +++++ .../htdocs/luci-static/resources/view/firewall/rules.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index a10cd2eead..524688233b 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -348,6 +348,11 @@ return view.extend({ o = s.taboption('advanced', form.Flag, 'log', _('Enable logging'), _('Log matched packets to syslog.')); o.modalonly = true; + o = s.taboption('advanced', form.Value, 'log_limit', _('Limit log messages')); + o.depends('log', '1'); + o.placeholder = '10/minute'; + o.modalonly = true; + if (!L.hasSystemFeature('firewall4')) { o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'), _('Passes additional arguments to iptables. Use with care!')); diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js index 73deea1259..c4383f268f 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js @@ -469,6 +469,11 @@ return view.extend({ o = s.taboption('advanced', form.Flag, 'log', _('Enable logging'), _('Log matched packets to syslog.')); o.modalonly = true; + o = s.taboption('advanced', form.Value, 'log_limit', _('Limit log messages')); + o.depends('log', '1'); + o.placeholder = '10/minute'; + o.modalonly = true; + if (!L.hasSystemFeature('firewall4')) { o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'), _('Passes additional arguments to iptables. Use with care!')); -- 2.30.2