luci-app-https-dns-proxy: bugfix: editing providers with options 6822/head
authorStan Grishin <stangri@melmac.ca>
Tue, 9 Jan 2024 03:21:20 +0000 (03:21 +0000)
committerStan Grishin <stangri@melmac.ca>
Tue, 9 Jan 2024 03:23:21 +0000 (03:23 +0000)
* fixes https://github.com/openwrt/luci/issues/6811
* previously editing existing provider instance with options would not
  result in the correct saving of edited parameters

Signed-off-by: Stan Grishin <stangri@melmac.ca>
(cherry picked from commit a83427fefe497fcda92a3f9b59701dc91a6f1df1)

applications/luci-app-https-dns-proxy/Makefile
applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js

index b0daecedf9457481e377dad411d29de7869b6b0d..3e6209c1373a80bec7a0d192d24d9e4516b052ca 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
-PKG_VERSION:=2023-10-25-5
+PKG_VERSION:=2023-11-19-1
 
 LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
 LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy
index a9bc25b9053a048fd19855ca9b8227f450fb494c..253525fb4af2aa113c871fece376d6f8357b60e8 100644 (file)
@@ -297,8 +297,8 @@ return view.extend({
                                                section_id,
                                                "resolver_url"
                                        );
-                                       if (_paramList.template !== template) return 0;
-                                       let resolver = pkg.templateToResolver(template, {
+                                       if (!formvalue && _paramList.template !== template) return 0;
+                                       let resolver = pkg.templateToResolver(_paramList.template, {
                                                option: formvalue || "",
                                        });
                                        L.uci.set(pkg.Name, section_id, "resolver_url", resolver);
@@ -335,8 +335,8 @@ return view.extend({
                                                section_id,
                                                "resolver_url"
                                        );
-                                       if (_paramText.template !== template) return 0;
-                                       let resolver = pkg.templateToResolver(template, {
+                                       if (!formvalue && _paramText.template !== template) return 0;
+                                       let resolver = pkg.templateToResolver(_paramText.template, {
                                                option: formvalue || "",
                                        });
                                        L.uci.set(pkg.Name, section_id, "resolver_url", resolver);