return "adblock-fast";
},
get LuciCompat() {
- return 8;
+ return 9;
},
get ReadmeCompat() {
return "";
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([
pkg.LuciCompat,
reply.status.rpcdCompat,
'<a href="' +
- pkg.URL +
- '#internal_version_mismatch" target="_blank">',
+ pkg.URL +
+ '#internal_version_mismatch" target="_blank">',
"</a>",
],
});
});
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({
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 ""
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 ""
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 ""
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 ""
"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 ""
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 ""
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"
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""