Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/js/settings-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ function fillDNSupstreams(value, servers) {

// Add event listener to checkboxes (shared across the Plain/DoT/DoH tabs)
$("input[id^='DNSupstreams-']").on("change", () => {
const upstreams = $("#DNSupstreamsTextfield").val().split("\n");
const upstreams = $("#DNSupstreamsTextfield").val().split(/\r?\n/u).filter(Boolean);
Comment thread
Copilot marked this conversation as resolved.
Outdated
let customServerCount = 0;
$("#DNSupstreamsTable input").each(function () {
$("#DNSupstreamTabs table input").each(function () {
const title = $(this).closest("td").attr("title");
if (!title) {
return;
}

if (this.checked && !upstreams.includes(title)) {
// Add server to array
upstreams.push(title);
Expand Down
2 changes: 1 addition & 1 deletion settings-dns.lp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mg.include('scripts/lua/settings_header.lp','r')
<div class="box-body">
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<div class="nav-tabs-custom" id="DNSupstreamTabs">
<ul class="nav nav-tabs" role="tablist">
<li class="active" role="presentation">
<a href="#tab-upstreams-plain" aria-controls="tab-upstreams-plain" aria-expanded="true" role="tab" data-toggle="tab">Plain <span class="label label-primary" id="upstreams-count-plain" style="display: none;"></span></a>
Expand Down