-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
diff --git a/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js | ||
index d891526..04fd5af 100644 | ||
--- a/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js | ||
+++ b/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js | ||
@@ -672,26 +672,12 @@ return view.extend({ | ||
return node; | ||
}, | ||
|
||
- checkLegacyRules: function(ipt4save, ipt6save) { | ||
- if (ipt4save.match(/\n-A /) || ipt6save.match(/\n-A /)) { | ||
- ui.addNotification(_('Legacy rules detected'), [ | ||
- E('p', _('There are legacy iptables rules present on the system. Mixing iptables and nftables rules is discouraged and may lead to incomplete traffic filtering.')), | ||
- E('button', { | ||
- 'class': 'btn cbi-button', | ||
- 'click': function() { location.href = 'nftables/iptables' } | ||
- }, _('Open iptables rules overview…')) | ||
- ], 'warning'); | ||
- } | ||
- }, | ||
- | ||
render: function(data) { | ||
var view = E('div'), | ||
nft = data[0], | ||
ipt = data[1], | ||
ipt6 = data[2]; | ||
|
||
- this.checkLegacyRules(ipt, ipt6); | ||
- | ||
if (!Array.isArray(nft.nftables)) | ||
return E('em', _('No nftables ruleset loaded.')); | ||
|
||
diff --git a/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json b/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json | ||
index 190eef0..e9cf485 100644 | ||
--- a/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json | ||
+++ b/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json | ||
@@ -39,20 +39,33 @@ | ||
} | ||
}, | ||
|
||
- "admin/status/nftables": { | ||
+ "admin/status/firewall": { | ||
"title": "Firewall", | ||
"order": 3, | ||
+ "action": { | ||
+ "type": "alias", | ||
+ "path": "admin/status/firewall/nftables" | ||
+ }, | ||
+ "depends": { | ||
+ "acl": [ "luci-mod-status-firewall" ] | ||
+ } | ||
+ }, | ||
+ | ||
+ "admin/status/firewall/nftables": { | ||
+ "title": "NFtables Firewall", | ||
+ "order": 1, | ||
"action": { | ||
"type": "view", | ||
"path": "status/nftables" | ||
}, | ||
"depends": { | ||
- "acl": [ "luci-mod-status-firewall" ], | ||
"fs": { "/usr/sbin/nft": "executable" } | ||
} | ||
}, | ||
|
||
- "admin/status/nftables/iptables": { | ||
+ "admin/status/firewall/iptables": { | ||
+ "title": "IPtables Firewall", | ||
+ "order": 2, | ||
"action": { | ||
"type": "view", | ||
"path": "status/iptables" |