fix: read dns_type from DOM select instead of UCI for dynamic DNS server filtering
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user