diff --git a/applications/luci-app-banip/Makefile b/applications/luci-app-banip/Makefile index f841ac2309..b5a7f8a851 100644 --- a/applications/luci-app-banip/Makefile +++ b/applications/luci-app-banip/Makefile @@ -7,7 +7,7 @@ LUCI_TITLE:=LuCI support for banIP LUCI_DEPENDS:=+luci-base +banip PKG_VERSION:=1.8.8 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=Dirk Brenken diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/setreport.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/setreport.js index d740c0b7b2..ac739d6740 100644 --- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/setreport.js +++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/setreport.js @@ -362,18 +362,23 @@ return view.extend({ L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['report', 'gen']), ''); let attempts = 0; let poller = setInterval(function () { - attempts++; L.resolveDefault(fs.read('/var/run/banIP/banIP.report'), '').then(function (res) { - if (res && res.trim()) { + res = (res || '').trim(); + if (res === '1') { clearInterval(poller); location.reload(); - } else if (attempts >= 40) { - clearInterval(poller); - btn.classList.remove('spinning'); - document.querySelectorAll('.cbi-page-actions button').forEach(function (b) { - b.disabled = false; - }); - ui.addNotification(null, E('p', _('Failed to generate a banIP report!')), 'error'); + } else if (res === '0') { + // keep polling, no attempt counter + } else { + attempts++; + if (attempts >= 10) { + clearInterval(poller); + btn.classList.remove('spinning'); + document.querySelectorAll('.cbi-page-actions button').forEach(function (b) { + b.disabled = false; + }); + ui.addNotification(null, E('p', _('Failed to generate a banIP report!')), 'error'); + } } }); }, 3000);