From c90c34e7120fe1740c8faa46945c16a8341631db Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Wed, 14 Feb 2024 04:45:17 +0000 Subject: [PATCH] luci-app-adblock-fast: bugfix: dnsmasq_instance & smartdns_instance parsing Signed-off-by: Stan Grishin --- applications/luci-app-adblock-fast/Makefile | 2 +- .../resources/view/adblock-fast/overview.js | 32 +++-- .../po/templates/adblock-fast.pot | 124 +++++++++--------- 3 files changed, 81 insertions(+), 77 deletions(-) diff --git a/applications/luci-app-adblock-fast/Makefile b/applications/luci-app-adblock-fast/Makefile index 0157ef4c57..47cdeb1f88 100644 --- a/applications/luci-app-adblock-fast/Makefile +++ b/applications/luci-app-adblock-fast/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin -PKG_VERSION:=1.1.1-3 +PKG_VERSION:=1.1.1-5 LUCI_TITLE:=AdBlock-Fast Web UI LUCI_DESCRIPTION:=Provides Web UI for adblock-fast service. diff --git a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js index e625106483..e97722317c 100644 --- a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js +++ b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js @@ -209,13 +209,15 @@ return view.extend({ section_id, "dnsmasq_instance" ); - switch (val) { - case "*": - case "-": - return val; - default: - return "+"; - } + if (val && val[0]) { + switch (val[0]) { + case "*": + case "-": + return val[0]; + default: + return "+"; + } + } else return "*"; }; o.write = function (section_id, formvalue) { L.uci.set(pkg.Name, section_id, "dnsmasq_instance", formvalue); @@ -270,13 +272,15 @@ return view.extend({ section_id, "smartdns_instance" ); - switch (val) { - case "*": - case "-": - return val; - default: - return "+"; - } + if (val && val[0]) { + switch (val[0]) { + case "*": + case "-": + return val[0]; + default: + return "+"; + } + } else return "*"; }; o.write = function (section_id, formvalue) { L.uci.set(pkg.Name, section_id, "smartdns_instance", formvalue); diff --git a/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot b/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot index 1871dc54ab..874c6386bc 100644 --- a/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot +++ b/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot @@ -18,7 +18,7 @@ msgstr "" msgid "-" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:515 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:519 msgid "Action" msgstr "" @@ -32,12 +32,12 @@ msgid "AdBlock Fast" msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:199 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:261 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:263 msgid "AdBlock on all instances" msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:200 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:262 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:264 msgid "AdBlock on select instances" msgstr "" @@ -45,11 +45,11 @@ msgstr "" msgid "AdBlock-Fast" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:466 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:470 msgid "AdBlock-Fast - Allowed and Blocked Domains" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:490 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:494 msgid "AdBlock-Fast - Allowed and Blocked Lists URLs" msgstr "" @@ -61,11 +61,11 @@ msgstr "" msgid "AdBlock-Fast - Status" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:368 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:372 msgid "Add IPv6 entries" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:365 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:369 msgid "Add IPv6 entries to block-list." msgstr "" @@ -73,21 +73,21 @@ msgstr "" msgid "Advanced Configuration" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:516 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:521 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:520 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:525 msgid "Allow" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:474 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:478 msgid "Allowed Domains" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:429 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:433 msgid "" "Attempt to create a compressed cache of block-list in the persistent memory." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:353 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:357 msgid "Automatic Config Update" msgstr "" @@ -95,12 +95,12 @@ msgstr "" msgid "Basic Configuration" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:517 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:521 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:525 msgid "Block" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:482 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:486 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:87 msgid "Blocked Domains" msgstr "" @@ -141,15 +141,15 @@ msgstr "" msgid "Config (%s) validation failure!" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:326 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:330 msgid "Controls system log and console output verbosity." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:402 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:406 msgid "Curl download retry" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:389 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:393 msgid "Curl maximum file size (in bytes)" msgstr "" @@ -162,21 +162,21 @@ msgstr "" msgid "DNS resolution option, see the %sREADME%s for details." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:440 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:444 msgid "Directory for compressed cache file" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:442 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:446 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:429 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:356 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:360 msgid "Disable" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:458 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:462 msgid "Disable Debugging" msgstr "" @@ -192,19 +192,19 @@ msgstr "" msgid "Dnsmasq Config File URL" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:367 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:371 msgid "Do not add IPv6 entries" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:432 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:436 msgid "Do not store compressed cache" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:419 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:423 msgid "Do not use simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:379 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:383 msgid "Download time-out (in seconds)" msgstr "" @@ -214,17 +214,17 @@ msgid "Downloading lists" msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:410 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:357 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:511 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:361 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:515 msgid "Enable" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:455 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:459 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:463 msgid "Enable Debugging" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:456 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:460 msgid "Enables debug output to /tmp/adblock-fast.log." msgstr "" @@ -349,11 +349,11 @@ msgstr "" msgid "Force Reloading" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:314 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:318 msgid "Force Router DNS" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:318 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:322 msgid "Force Router DNS server to all local devices" msgstr "" @@ -361,7 +361,7 @@ msgstr "" msgid "Force redownloading %s block lists" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:315 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:319 msgid "Forces Router DNS use on local devices, also known as DNS Hijacking." msgstr "" @@ -373,27 +373,27 @@ msgstr "" msgid "Grant UCI and file access for luci-app-adblock-fast" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:364 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:368 msgid "IPv6 Support" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:391 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:395 msgid "" "If curl is installed and detected, it would not download files bigger than " "this." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:404 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:408 msgid "" "If curl is installed and detected, it would retry download this many times " "on timeout/fail." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:475 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:479 msgid "Individual domains to be allowed." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:483 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:487 msgid "Individual domains to be blocked." msgstr "" @@ -401,21 +401,21 @@ msgstr "" msgid "Invalid compressed cache directory '%s'" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:338 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:342 msgid "LED to indicate status" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:416 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:420 msgid "" "Launch all lists downloads and processing simultaneously, reducing service " "start time." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:317 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:321 msgid "Let local devices use their own DNS servers if set" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:263 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:265 msgid "No AdBlock on SmartDNS" msgstr "" @@ -435,7 +435,7 @@ msgstr "" msgid "Not installed or not found" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:325 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:329 msgid "Output Verbosity Setting" msgstr "" @@ -447,19 +447,19 @@ msgstr "" msgid "Pausing %s" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:354 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:358 msgid "Perform config update before downloading the block/allow-lists." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:340 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:344 msgid "Pick the LED not already used in %sSystem LED Configuration%s." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:289 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:293 msgid "Pick the SmartDNS instance(s) for AdBlocking" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:228 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:230 msgid "Pick the dnsmasq instance(s) for AdBlocking" msgstr "" @@ -506,19 +506,19 @@ msgstr "" msgid "Service Warnings" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:414 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:418 msgid "Simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:498 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:502 msgid "Size" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:508 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:512 msgid "Size: %s" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:329 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:333 msgid "Some output" msgstr "" @@ -547,7 +547,7 @@ msgstr "" msgid "Stop" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:380 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:384 msgid "Stop the download if it is stalled for set number of seconds." msgstr "" @@ -560,15 +560,15 @@ msgstr "" msgid "Stopping %s service" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:433 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:437 msgid "Store compressed cache" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:427 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:431 msgid "Store compressed cache file on router" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:328 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:332 msgid "Suppress output" msgstr "" @@ -598,7 +598,7 @@ msgstr "" msgid "The dnsmasq nft sets support is enabled, but nft is not installed" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:524 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:528 msgid "URL" msgstr "" @@ -607,11 +607,11 @@ msgid "" "URL to the external dnsmasq config file, see the %sREADME%s for details." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:491 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:495 msgid "URLs to file(s) containing lists to be allowed or blocked." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:502 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:506 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:95 msgid "Unknown" msgstr "" @@ -624,7 +624,7 @@ msgstr "" msgid "Unknown warning" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:253 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:255 msgid "Use AdBlocking on the SmartDNS instance(s)" msgstr "" @@ -637,11 +637,11 @@ msgid "" "Use of external dnsmasq config file detected, please set '%s' option to '%s'" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:420 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:424 msgid "Use simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:330 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:334 msgid "Verbose output" msgstr "" @@ -657,7 +657,7 @@ msgstr "" msgid "Warning" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:255 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:257 msgid "" "You can limit the AdBlocking to the specific SmartDNS instance(s) (%smore " "information%s)." @@ -689,7 +689,7 @@ msgstr "" msgid "dnsmasq servers file" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:343 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:347 msgid "none" msgstr "" -- 2.30.2