fix: read dns_type from DOM select instead of UCI for dynamic DNS server filtering

This commit is contained in:
Dushnilin
2026-07-31 19:01:07 +03:00
parent bc04794b73
commit 6061c92571
2 changed files with 5 additions and 3 deletions
@@ -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) }));
});
@@ -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");