summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-banip/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2024-05-30 22:13:17 +0200
committerDirk Brenken <dev@brenken.org>2024-05-30 22:13:17 +0200
commitb4fc61a0c5dc6d613ffd659114fa073b31b02230 (patch)
tree75e0bd526a998408bae7f30db68fb83bcae96af8 /applications/luci-app-banip/htdocs/luci-static/resources
parentc27c0b2505dc4cde9ab1b5de97eabbc6b3c79c71 (diff)
luci-app-banip: sync with 0.9.6-2
small fixes & improvements Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-banip/htdocs/luci-static/resources')
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js12
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js12
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js2
-rw-r--r--applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js10
4 files changed, 26 insertions, 10 deletions
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js
index 6b54f2946e..4610eb56a9 100644
--- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js
+++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js
@@ -3,6 +3,8 @@
'require fs';
'require ui';
+let notMsg, errMsg;
+
return view.extend({
load: function () {
return Promise.all([
@@ -16,10 +18,16 @@ return view.extend({
.then(function () {
document.querySelector('textarea').value = value;
document.body.scrollTop = document.documentElement.scrollTop = 0;
- ui.addNotification(null, E('p', _('Allowlist modifications have been saved, start the Domain Lookup or restart banIP that changes take effect.')), 'info');
+ if (!notMsg) {
+ ui.addNotification(null, E('p', _('Allowlist modifications have been saved, reload banIP that changes take effect.')), 'info');
+ notMsg = true;
+ }
}).catch(function (e) {
document.body.scrollTop = document.documentElement.scrollTop = 0;
- ui.addNotification(null, E('p', _('Unable to save modifications: %s').format(e.message)), 'error');
+ if (!errMsg) {
+ ui.addNotification(null, E('p', _('Unable to save modifications: %s').format(e.message)), 'error');
+ errMsg = true;
+ }
});
},
render: function (allowlist) {
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
index 8dede44e52..1ebdd38167 100644
--- 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
@@ -3,6 +3,8 @@
'require fs';
'require ui';
+let notMsg, errMsg;
+
return view.extend({
load: function () {
return Promise.all([
@@ -16,10 +18,16 @@ return view.extend({
.then(function () {
document.querySelector('textarea').value = value;
document.body.scrollTop = document.documentElement.scrollTop = 0;
- ui.addNotification(null, E('p', _('Blocklist modifications have been saved, start the Domain Lookup or restart banIP that changes take effect.')), 'info');
+ if (!notMsg) {
+ ui.addNotification(null, E('p', _('Blocklist modifications have been saved, reload banIP that changes take effect.')), 'info');
+ notMsg = true;
+ }
}).catch(function (e) {
document.body.scrollTop = document.documentElement.scrollTop = 0;
- ui.addNotification(null, E('p', _('Unable to save modifications: %s').format(e.message)), 'error');
+ if (!errMsg) {
+ ui.addNotification(null, E('p', _('Unable to save modifications: %s').format(e.message)), 'error');
+ errMsg = true;
+ }
});
},
render: function (blocklist) {
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js
index e6704efdca..2dc085932d 100644
--- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js
+++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/feeds.js
@@ -173,7 +173,7 @@ return view.extend({
m = new form.JSONMap(data, _('Custom Feed Editor'), _('With this editor you can upload your local custom feed file or fill up an initial one (a 1:1 copy of the version shipped with the package). \
The file is located at \'/etc/banip/banip.custom.feeds\'. \
- Then you can edit this file, delete entries, add new ones or make a local backup. To go back to the maintainers version just empty the custom feed file again (do not delete it!).'));
+ Then you can edit this file, delete entries, add new ones or make a local backup. To go back to the maintainers version just clear the custom feed file.'));
for (let i = 0; i < Object.keys(m.data.data).length; i++) {
feed = Object.keys(m.data.data)[i];
url_4 = m.data.data[feed].url_4;
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js
index c57f5f633f..81543ca732 100644
--- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js
+++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js
@@ -14,11 +14,11 @@
function handleAction(ev) {
if (ev === 'restart' || ev === 'reload') {
let map = document.querySelector('.cbi-map');
- return dom.callClassMethod(map, 'save')
- .then(L.bind(ui.changes.apply, ui.changes))
- .then(function() {
- return fs.exec_direct('/etc/init.d/banip', [ev]);
- });
+ dom.callClassMethod(map, 'save')
+ .then(L.bind(ui.changes.apply, ui.changes))
+ .then(function () {
+ return fs.exec_direct('/etc/init.d/banip', [ev]);
+ });
} else {
return fs.exec_direct('/etc/init.d/banip', [ev]);
}