summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-banip/htdocs/luci-static
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2023-03-07 11:16:56 +0100
committerDirk Brenken <dev@brenken.org>2023-03-07 11:16:56 +0100
commit9c5c39fef40e6a6010861a8299a12096450406b7 (patch)
tree008a61943ee468a013ab5e6fd50f55a19a2b38db /applications/luci-app-banip/htdocs/luci-static
parentd04a47e5a8afbc500e053f41dbe5011769c4435c (diff)
luci-app-banip: fix local blocklist access
* accidently commit the old local blacklist js with the former PR - fixed now. * sync translations Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-banip/htdocs/luci-static')
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blacklist.js37
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js37
2 files changed, 37 insertions, 37 deletions
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blacklist.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blacklist.js
deleted file mode 100644
index f172158063..0000000000
--- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blacklist.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-'require view';
-'require fs';
-'require ui';
-
-return view.extend({
- load: function() {
- return L.resolveDefault(fs.read_direct('/etc/banip/banip.blacklist'), '');
- },
- handleSave: function(ev) {
- var value = ((document.querySelector('textarea').value || '').trim().toLowerCase().replace(/\r\n/g, '\n')) + '\n';
- return fs.write('/etc/banip/banip.blacklist', value)
- .then(function(rc) {
- document.querySelector('textarea').value = value;
- ui.addNotification(null, E('p', _('Blacklist changes have been saved. Refresh your banIP lists that changes take effect.')), 'info');
- }).catch(function(e) {
- ui.addNotification(null, E('p', _('Unable to save changes: %s').format(e.message)));
- });
- },
- render: function(blacklist) {
- return E([
- E('p', {},
- _('This is the local banIP blacklist to always-deny certain IP/CIDR addresses.<br /> \
- <em><b>Please note:</b></em> add only one IPv4 address, IPv6 address or domain name per line. Comments introduced with \'#\' are allowed - wildcards and regex are not.')),
- E('p', {},
- E('textarea', {
- 'style': 'width: 100% !important; padding: 5px; font-family: monospace',
- 'spellcheck': 'false',
- 'wrap': 'off',
- 'rows': 25
- }, [ blacklist != null ? blacklist : '' ])
- )
- ]);
- },
- handleSaveApply: null,
- handleReset: null
-});
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js
new file mode 100644
index 0000000000..888a189ed0
--- /dev/null
+++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js
@@ -0,0 +1,37 @@
+'use strict';
+'require view';
+'require fs';
+'require ui';
+
+return view.extend({
+ load: function () {
+ return L.resolveDefault(fs.read_direct('/etc/banip/banip.blocklist'), '');
+ },
+ handleSave: function (ev) {
+ var value = ((document.querySelector('textarea').value || '').trim().toLowerCase().replace(/\r\n/g, '\n')) + '\n';
+ return fs.write('/etc/banip/banip.blocklist', value)
+ .then(function (rc) {
+ document.querySelector('textarea').value = value;
+ ui.addNotification(null, E('p', _('Blocklist modifications have been saved, restart banIP that changes take effect.')), 'info');
+ }).catch(function (e) {
+ ui.addNotification(null, E('p', _('Unable to save modifications: %s').format(e.message)));
+ });
+ },
+ render: function (blocklist) {
+ return E([
+ E('p', {},
+ _('This is the local banIP blocklist that will prevent certain MAC/IP/CIDR addresses.<br /> \
+ <em><b>Please note:</b></em> add only exactly one MAC/IPv4/IPv6 address or domain name per line.')),
+ E('p', {},
+ E('textarea', {
+ 'style': 'width: 100% !important; padding: 5px; font-family: monospace',
+ 'spellcheck': 'false',
+ 'wrap': 'off',
+ 'rows': 25
+ }, [blocklist != null ? blocklist : ''])
+ )
+ ]);
+ },
+ handleSaveApply: null,
+ handleReset: null
+});