luci-app-adblock-fast: update to 1.2.0-26
authorStan Grishin <redacted>
Sun, 4 Jan 2026 19:29:18 +0000 (19:29 +0000)
committerStan Grishin <redacted>
Sun, 4 Jan 2026 19:29:43 +0000 (19:29 +0000)
* sync Compat with principal package
* better modal popup UE on long operations (thanks @Aethersailor)

Signed-off-by: Stan Grishin <redacted>
applications/luci-app-adblock-fast/Makefile
applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js
applications/luci-app-adblock-fast/po/templates/adblock-fast.pot
applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast

index a3d2d3c41748d775e2f1c8f04d469e258534e0fc..ba9215b443895d577e417ad6df3438210f37e0c9 100644 (file)
@@ -7,7 +7,7 @@ PKG_NAME:=luci-app-adblock-fast
 PKG_LICENSE:=AGPL-3.0-or-later
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
 PKG_VERSION:=1.2.0
-PKG_RELEASE:=20
+PKG_RELEASE:=26
 
 LUCI_TITLE:=AdBlock-Fast Web UI
 LUCI_URL:=https://github.com/stangri/luci-app-adblock-fast/
index 1ca82275e9b50280f44928d0125ac23b7ca56120..4f172cbd582ec6116cc7cf7f8b272176461472fa 100644 (file)
@@ -12,7 +12,7 @@ var pkg = {
                return "adblock-fast";
        },
        get LuciCompat() {
-               return 8;
+               return 9;
        },
        get ReadmeCompat() {
                return "";
@@ -213,10 +213,56 @@ var RPC = {
                        function (result) {
                                this.emit("setInitAction", result);
                        }.bind(this)
+               ).catch(
+                       function (error) {
+                               // Even if RPC call fails/times out, emit event to start polling
+                               // This handles cases where the backend task starts but RPC times out
+                               this.emit("setInitAction", { timeout: true });
+                       }.bind(this)
                );
        },
 };
 
+// Poll service status until completion (for long-running operations like download)
+var pollServiceStatus = function (callback) {
+       var maxAttempts = 120; // Max 2 minutes of polling
+       var attempt = 0;
+
+       var checkStatus = function () {
+               attempt++;
+
+               // Use the RPC function directly from the module scope
+               L.resolveDefault(getInitStatus(pkg.Name), {}).then(function (statusData) {
+                       var currentStatus = statusData && statusData[pkg.Name] && statusData[pkg.Name].status;
+
+                       // Check if completed or failed
+                       if (currentStatus === 'statusSuccess' ||
+                               currentStatus === 'statusFail' ||
+                               currentStatus === 'statusStopped') {
+                               callback(true, currentStatus);
+                       }
+                       // Check if timed out
+                       else if (attempt >= maxAttempts) {
+                               callback(false, 'timeout');
+                       }
+                       // Continue polling
+                       else {
+                               setTimeout(checkStatus, 1000); // Check again in 1 second
+                       }
+               }).catch(function (err) {
+                       // Retry on error unless timed out
+                       if (attempt < maxAttempts) {
+                               setTimeout(checkStatus, 1000);
+                       } else {
+                               callback(false, 'error');
+                       }
+               });
+       };
+
+       // Start polling after 2 seconds delay (give backend time to start the task)
+       setTimeout(checkStatus, 2000);
+};
+
 var status = baseclass.extend({
        render: function () {
                return Promise.all([
@@ -266,8 +312,8 @@ var status = baseclass.extend({
                                                pkg.LuciCompat,
                                                reply.status.rpcdCompat,
                                                '<a href="' +
-                                                       pkg.URL +
-                                                       '#internal_version_mismatch" target="_blank">',
+                                               pkg.URL +
+                                               '#internal_version_mismatch" target="_blank">',
                                                "</a>",
                                        ],
                                });
@@ -599,8 +645,12 @@ var status = baseclass.extend({
 });
 
 RPC.on("setInitAction", function (reply) {
-       ui.hideModal();
-       location.reload();
+       // Don't immediately hide modal and reload
+       // Instead, poll status until the operation actually completes
+       pollServiceStatus(function () {
+               ui.hideModal();
+               location.reload();
+       });
 });
 
 return L.Class.extend({
index 206f1456575775bd315dcbf9b05896663ea4ebd4..e12733275f902b62c3015e0003986ed8d8388380 100644 (file)
@@ -55,7 +55,7 @@ msgstr ""
 msgid "AdBlock-Fast - Configuration"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:279
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:325
 msgid "AdBlock-Fast - Status"
 msgstr ""
 
@@ -103,7 +103,7 @@ msgstr ""
 msgid "Blocked Domains"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:292
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:338
 msgid "Blocking %s domains (with %s)."
 msgstr ""
 
@@ -115,7 +115,7 @@ msgstr ""
 msgid "Cache file"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:327
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:373
 msgid "Cache file found."
 msgstr ""
 
@@ -127,11 +127,11 @@ msgstr ""
 msgid "Compressed cache"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:297
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:343
 msgid "Compressed cache file created."
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:329
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:375
 msgid "Compressed cache file found."
 msgstr ""
 
@@ -169,7 +169,7 @@ msgid ""
 "Directory for compressed cache file of block-list in the persistent memory."
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:526
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:572
 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:348
 msgid "Disable"
 msgstr ""
@@ -178,11 +178,11 @@ msgstr ""
 msgid "Disable Debugging"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:323
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:369
 msgid "Disabled"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:520
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:566
 msgid "Disabling %s service"
 msgstr ""
 
@@ -210,7 +210,7 @@ msgstr ""
 msgid "Downloading lists"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:507
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:553
 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:349
 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:503
 msgid "Enable"
@@ -225,11 +225,11 @@ msgstr ""
 msgid "Enables debug output to /tmp/adblock-fast.log."
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:501
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:547
 msgid "Enabling %s service"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:400
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:446
 msgid "Errors encountered, please check the %sREADME%s"
 msgstr ""
 
@@ -329,7 +329,7 @@ msgstr ""
 msgid "Force DNS Ports"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:300
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:346
 msgid "Force DNS ports:"
 msgstr ""
 
@@ -345,7 +345,7 @@ msgstr ""
 msgid "Force Router DNS server to all local devices"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:448
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:494
 msgid "Force redownloading %s block lists"
 msgstr ""
 
@@ -442,7 +442,7 @@ msgstr ""
 msgid "No blocked list URLs nor blocked-domains enabled"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:343
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:389
 msgid "Not installed or not found"
 msgstr ""
 
@@ -450,11 +450,11 @@ msgstr ""
 msgid "Output Verbosity Setting"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:469
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:515
 msgid "Pause"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:464
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:510
 msgid "Pausing %s"
 msgstr ""
 
@@ -474,7 +474,7 @@ msgstr ""
 msgid "Pick the dnsmasq instance(s) for ad-blocking"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:310
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:356
 msgid "Please %sdonate%s to support development of this project."
 msgstr ""
 
@@ -495,7 +495,7 @@ msgstr ""
 msgid "Processing lists"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:454
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:500
 msgid "Redownload"
 msgstr ""
 
@@ -511,19 +511,19 @@ msgstr ""
 msgid "Sanity check discovered leading dots in %s"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:567
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:613
 msgid "Service Control"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:387
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:433
 msgid "Service Errors"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:283
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:329
 msgid "Service Status"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:357
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:403
 msgid "Service Warnings"
 msgstr ""
 
@@ -543,7 +543,7 @@ msgstr ""
 msgid "Some output"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:435
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:481
 msgid "Start"
 msgstr ""
 
@@ -551,7 +551,7 @@ msgstr ""
 msgid "Starting"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:429
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:475
 msgid "Starting %s service"
 msgstr ""
 
@@ -559,7 +559,7 @@ msgstr ""
 msgid "Status"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:488
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:534
 msgid "Stop"
 msgstr ""
 
@@ -571,7 +571,7 @@ msgstr ""
 msgid "Stopped"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:482
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:528
 msgid "Stopping %s service"
 msgstr ""
 
@@ -641,7 +641,7 @@ msgstr ""
 msgid "Unknown"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:397
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:443
 msgid "Unknown error"
 msgstr ""
 
@@ -649,7 +649,7 @@ msgstr ""
 msgid "Unknown message"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:367
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:413
 msgid "Unknown warning"
 msgstr ""
 
@@ -678,7 +678,7 @@ msgstr ""
 msgid "Version"
 msgstr ""
 
-#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:286
+#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:332
 msgid "Version %s"
 msgstr ""
 
index 0fbfce43f7ed77364fd41e44e4dfdc171324c327..df1b48e59a3f476dde12b001807205317f25cf1f 100755 (executable)
@@ -15,7 +15,7 @@
 # ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "pause" }'
 # ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "stop" }'
 
-readonly rpcdCompat='8'
+readonly rpcdCompat='9'
 readonly adbFunctionsFile="${IPKG_INSTROOT}/etc/init.d/adblock-fast"
 if [ -s "$adbFunctionsFile" ]; then
 # shellcheck source=../../../../../adblock-fast/files/etc/init.d/adblock-fast
git clone https://git.99rst.org/PROJECT