luci-app-https-dns-proxy: bugfix: editing providers with options

* 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>
This commit is contained in:
Stan Grishin
2024-01-09 03:21:20 +00:00
parent 49f9b430fd
commit a83427fefe
3 changed files with 5 additions and 344 deletions
@@ -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);