mirror of
https://github.com/openwrt/luci.git
synced 2026-05-31 10:31:55 +08:00
luci-app-adblock: update 4.5.5-5
* sync with base package
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit c707d21a01)
This commit is contained in:
@@ -7,7 +7,7 @@ LUCI_TITLE:=LuCI support for Adblock
|
||||
LUCI_DEPENDS:=+luci-base +luci-lib-uqr +adblock
|
||||
|
||||
PKG_VERSION:=4.5.5
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=5
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
+14
-9
@@ -217,19 +217,24 @@ function handleAction(ev) {
|
||||
L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['report', 'gen', top_count, res_count, search]), '');
|
||||
let attempts = 0;
|
||||
let poller = setInterval(function () {
|
||||
attempts++;
|
||||
L.resolveDefault(fs.read('/var/run/adblock/adblock.report'), '').then(function (res) {
|
||||
if (res && res.trim()) {
|
||||
res = (res || '').trim();
|
||||
if (res === '1') {
|
||||
clearInterval(poller);
|
||||
ui.hideModal();
|
||||
location.reload();
|
||||
} else if (attempts >= 40) {
|
||||
clearInterval(poller);
|
||||
document.querySelectorAll('.cbi-page-actions button').forEach(function (btn) {
|
||||
btn.disabled = false;
|
||||
});
|
||||
document.getElementById('refresh').classList.remove('spinning');
|
||||
ui.addNotification(null, E('p', _('Failed to generate adblock report!')), 'error');
|
||||
} else if (res === '0') {
|
||||
// keep polling
|
||||
} else {
|
||||
attempts++;
|
||||
if (attempts >= 10) {
|
||||
clearInterval(poller);
|
||||
document.querySelectorAll('.cbi-page-actions button').forEach(function (btn) {
|
||||
btn.disabled = false;
|
||||
});
|
||||
document.getElementById('refresh').classList.remove('spinning');
|
||||
ui.addNotification(null, E('p', _('Failed to generate adblock report!')), 'error');
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
Reference in New Issue
Block a user