From: Dirk Brenken Date: Thu, 30 May 2024 20:13:17 +0000 (+0200) Subject: luci-app-banip: sync with 0.9.6-2 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b4fc61a0c5dc6d613ffd659114fa073b31b02230;p=project%2Fluci.git luci-app-banip: sync with 0.9.6-2 small fixes & improvements Signed-off-by: Dirk Brenken --- 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]); } diff --git a/applications/luci-app-banip/po/templates/banip.pot b/applications/luci-app-banip/po/templates/banip.pot index 8e8f8cfce7..feb0066e89 100644 --- a/applications/luci-app-banip/po/templates/banip.pot +++ b/applications/luci-app-banip/po/templates/banip.pot @@ -72,10 +72,10 @@ msgstr "" msgid "Allowlist Only" msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:19 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:22 msgid "" -"Allowlist modifications have been saved, start the Domain Lookup or restart " -"banIP that changes take effect." +"Allowlist modifications have been saved, reload banIP that changes take " +"effect." msgstr "" #: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js:424 @@ -158,10 +158,10 @@ msgstr "" msgid "Blocklist Set Expiry" msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:19 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:22 msgid "" -"Blocklist modifications have been saved, start the Domain Lookup or restart " -"banIP that changes take effect." +"Blocklist modifications have been saved, reload banIP that changes take " +"effect." msgstr "" #: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js:507 @@ -855,11 +855,11 @@ msgstr "" msgid "Target directory for compressed feed backups." msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:28 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:36 msgid "The allowlist is too big, unable to save modifications." msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:28 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:36 msgid "The blocklist is too big, unable to save modifications." msgstr "" @@ -873,7 +873,7 @@ msgstr "" msgid "The selected priority will be used for banIP background processing." msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:32 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:40 msgid "" "This is the local banIP allowlist that will permit certain MAC-, IP-" "addresses or domain names.
Please note: add only " @@ -881,7 +881,7 @@ msgid "" "notation and MAC/IP-bindings are allowed." msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:32 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:40 msgid "" "This is the local banIP blocklist that will prevent certain MAC-, IP-" "addresses or domain names.
Please note: add only " @@ -955,8 +955,8 @@ msgstr "" msgid "Unable to parse the ruleset file!" msgstr "" -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:22 -#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:22 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/allowlist.js:28 +#: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/blocklist.js:28 msgid "Unable to save modifications: %s" msgstr "" @@ -1002,8 +1002,7 @@ msgid "" "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!)." +"maintainers version just clear the custom feed file." msgstr "" #: applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js:571