luci-app-firewall: add log_limit
authorJan Froch <jan@froch.eu>
Sat, 22 Feb 2025 01:19:49 +0000 (02:19 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Sun, 23 Feb 2025 18:49:34 +0000 (12:49 -0600)
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 <jan@froch.eu>
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js

index a10cd2eead2915576cd44cca341747dc09380d7f..524688233b4dfe81e9058f8f24b31a135d098300 100644 (file)
@@ -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!'));
index 73deea1259eea02daa8902638222c3a53cbfd4a6..c4383f268f3e5668f7cbed1dd49911359501761e 100644 (file)
@@ -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!'));