Show the interface name in Settings > DNS page (#3265)

This commit is contained in:
RD WebDesign
2025-02-28 03:25:26 -03:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -99,6 +99,11 @@ function fillDNSupstreams(value, servers) {
applyCheckboxRadioStyle();
}
function setInterfaceName(interface) {
$("#interface-name-1").text(interface);
$("#interface-name-2").text(interface);
}
// Update the textfield with all (incl. custom) upstream servers
function updateDNSserversTextfield(upstreams, customServers) {
$("#DNSupstreamsTextfield").val(upstreams.join("\n"));
@@ -114,6 +119,7 @@ function processDNSConfig() {
.done(function (data) {
// Initialize the DNS upstreams
fillDNSupstreams(data.config.dns.upstreams, data.dns_servers);
setInterfaceName(data.config.dns.interface.value);
setConfigValues("dns", "dns", data.config.dns);
})
.fail(function (data) {

View File

@@ -127,11 +127,11 @@ mg.include('scripts/lua/settings_header.lp','r')
<h4>Potentially dangerous options</h4>Make sure your Pi-hole is properly firewalled!
<div>
<input type="radio" name="DNSinterface" id="dns.listeningMode-SINGLE" data-key="dns.listeningMode" value="single">
<label for="dns.listeningMode-SINGLE"><strong>Respond only on interface <span id="interface-name-1"></span></strong></label>
<label for="dns.listeningMode-SINGLE"><strong>Respond only on interface <code id="interface-name-1"></code></strong></label>
</div>
<div>
<input type="radio" name="DNSinterface" id="dns.listeningMode-BIND" data-key="dns.listeningMode" value="bind">
<label for="dns.listeningMode-BIND"><strong>Bind only to interface <span id="interface-name-2"></span></strong></label>
<label for="dns.listeningMode-BIND"><strong>Bind only to interface <code id="interface-name-2"></code></strong></label>
</div>
<div>
<input type="radio" name="DNSinterface" id="dns.listeningMode-ALL" data-key="dns.listeningMode" value="all">