settings-dns: expand custom servers box if it has custom servers

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-06-14 19:07:15 +03:00
parent 30ff1cd556
commit 65e2917b74
2 changed files with 11 additions and 1 deletions

View File

@@ -94,6 +94,16 @@ function fillDNSupstreams(value, servers) {
// Initialize textfield
updateDNSserversTextfield(value.value, customServers);
// Expand the box if there are custom servers
// Not using the AdminLTE API so that the expansion is not animated
// Otherwise, we could use `$(customBox).boxWidget("expand")`
if (customServers > 0) {
const customBox = document.getElementById("custom-servers-box");
customBox.classList.remove("collapsed-box");
customBox.querySelector(".btn-box-tool > i").classList.replace("fa-plus", "fa-minus");
customBox.querySelector(".box-body").style = "";
}
// Hide the loading animation
$("#dns-upstreams-overlay").hide();

View File

@@ -36,7 +36,7 @@ mg.include('scripts/lua/settings_header.lp','r')
<p>ECS (Extended Client Subnet) defines a mechanism for recursive resolvers to send partial client IP address information to authoritative DNS name servers. Content Delivery Networks (CDNs) and latency-sensitive services use this to give geo-located responses when responding to name lookups coming through public DNS resolvers. <em>Note that ECS may result in reduced privacy.</em></p>
</div>
<div class="col-sm-12">
<div class="box collapsed-box">
<div class="box collapsed-box" id="custom-servers-box">
<div class="box-header with-border pointer" data-widget="collapse">
<h3 class="box-title">Custom DNS servers <span id="custom-servers-title"></span></h3>
<div class="box-tools pull-right">