fix: ensure resolvers have default port and update bank resolver handling

This commit is contained in:
Sarto
2026-04-15 01:38:36 +03:30
parent 1712206835
commit 7b65d605b8
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -3122,6 +3122,7 @@
setTimeout(function () { if (item.parentNode) item.parentNode.removeChild(item) }, 2000);
// Scan is done — load channels in case the SSE 'update' event was dropped.
setTimeout(function () { loadChannels().then(function () { if (channels.length > 0 && selectedChannel === 0) selectChannel(1) }) }, 3000);
refreshResolversBadge();
}
}
+6 -2
View File
@@ -1412,7 +1412,11 @@ func (s *Server) handleResolverBank(w http.ResponseWriter, r *http.Request) {
liveStats = s.fetcher.ExportStats()
activeSet = make(map[string]bool)
for _, r := range s.fetcher.Resolvers() {
activeSet[r] = true
k := r
if !strings.Contains(k, ":") {
k += ":53"
}
activeSet[k] = true
}
}
s.mu.RUnlock()
@@ -1431,11 +1435,11 @@ func (s *Server) handleResolverBank(w http.ResponseWriter, r *http.Request) {
var bank []bankResolver
for _, addr := range pl.ResolverBank {
br := bankResolver{Addr: addr, Active: activeSet[addr]}
key := addr
if !strings.Contains(key, ":") {
key += ":53"
}
br := bankResolver{Addr: addr, Active: activeSet[key]}
// Prefer live stats, fall back to saved scores.
if liveStats != nil {
if st, ok := liveStats[key]; ok {