mirror of
https://github.com/openwrt/luci.git
synced 2026-05-31 02:21:50 +08:00
luci-app-banip: update 1.8.8-4
* sync with base package Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -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 <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user