Skip to content

Commit

Permalink
Show the interface name in Settings > DNS page (#3265)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdwebdesign authored Feb 28, 2025
2 parents 22bfbd9 + 566bf15 commit 3ecc3e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions scripts/js/settings-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions settings-dns.lp
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 3ecc3e7

Please sign in to comment.