summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-12-13 23:49:11 +0100
committerJo-Philipp Wich <jo@mein.io>2022-12-13 23:49:11 +0100
commitbad783a6d2484489ea07ac786a03e729f089c244 (patch)
treeb75243fcb8b56dfebd4858de2fa5c8bafc0884a3 /modules
parent75dcb097547257d654e9b7f7d58578b9210968e5 (diff)
luci-mid-status: nftables.js: minor cleanups and enhancements
- Recognize `log` expression as action - Recognize `meta time` expression - Remove debug tooltip from `reject` targets Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
index 82660c1595..de2f3d4daa 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
@@ -25,6 +25,7 @@ var expr_translations = {
'meta.mark': _('Packet mark', 'nft meta mark'),
+ 'meta.time': _('Packet receive time', 'nft meta time'),
'meta.hour': _('Current time', 'nft meta hour'),
'meta.day': _('Current weekday', 'nft meta day'),
@@ -95,6 +96,7 @@ var action_translations = {
'accept': _('Accept packet', 'nft accept action'),
'drop': _('Drop packet', 'nft drop action'),
'jump': _('Continue in <strong><a href="#%q.%q">%h</a></strong>', 'nft jump action'),
+ 'log': _('Log event "<strong>%h</strong>…"', 'nft log action'),
'reject.tcp reset': _('Reject packet with <strong>TCP reset</strong>', 'nft reject with tcp reset'),
'reject.icmp': _('Reject IPv4 packet with <strong>ICMP type %h</strong>', 'nft reject with icmp type'),
@@ -154,6 +156,7 @@ return view.extend({
case 'masquerade':
case 'return':
case 'flow':
+ case 'log':
return true;
}
}
@@ -355,8 +358,7 @@ return view.extend({
var k = 'reject.%s'.format(spec.type);
return E('span', {
- 'class': 'ifacebadge',
- 'data-tooltip': JSON.stringify(spec)
+ 'class': 'ifacebadge'
}, (action_translations[k] || k).format(this.exprToString(spec.expr)));
case 'accept':
@@ -445,6 +447,11 @@ return view.extend({
'class': 'ifacebadge'
}, action_translations.flow.format(spec.flowtable.replace(/^@/, '')));
+ case 'log':
+ return E('span', {
+ 'class': 'ifacebadge'
+ }, action_translations.log.format(spec.prefix));
+
default:
return E('span', {
'class': 'ifacebadge',