From 6061c92571304b6ff44ffe507dcf848cc319f9b8 Mon Sep 17 00:00:00 2001 From: Dushnilin Date: Fri, 31 Jul 2026 19:01:07 +0300 Subject: [PATCH] fix: read dns_type from DOM select instead of UCI for dynamic DNS server filtering --- .../htdocs/luci-static/resources/view/tachyon/section.js | 3 ++- .../htdocs/luci-static/resources/view/tachyon/settings.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/section.js b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/section.js index 23b4af6a..434dcdbd 100644 --- a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/section.js +++ b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/section.js @@ -7257,7 +7257,8 @@ function createSectionContent(section) { o.depends("action", "dns"); o.modalonly = true; configureLiveDynamicListChoices(o, (section_id) => { - const dnsType = uci.get(UCI_PACKAGE, section_id, "dns_type") || "udp"; + const sel = document.getElementById("cbid.tachyon." + section_id + ".dns_type"); + const dnsType = (sel ? sel.value : null) || "udp"; const servers = main.DNS_SERVERS_BY_PROTOCOL[dnsType] || main.DNS_SERVERS_BY_PROTOCOL.udp; return Object.entries(servers).map(([value, label]) => ({ value, label: _(label) })); }); diff --git a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js index a9a596cf..0941c93a 100644 --- a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js +++ b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js @@ -951,8 +951,9 @@ function createSettingsContent(section, capabilities) { "Main DNS server. If multiple servers are selected, a timeout switches to a backup.", ), ); - configureDnsDynamicList(dnsOption, (section_id) => { - const dnsType = uci.get(UCI_PACKAGE, "settings", "dns_type") || "udp"; + configureDnsDynamicList(dnsOption, (_section_id) => { + const sel = document.getElementById("cbid.tachyon.settings.dns_type"); + const dnsType = (sel ? sel.value : null) || "udp"; return getDnsServerChoices(dnsType); }, "77.88.8.8");