fix: preserve service ID on subdomain change, accept localhost as IP

- serviceUrl() now checks service.url before falling back to buildServiceUrl(id)
- Service update no longer overwrites ID with the new subdomain
- Accept "localhost" as valid IP in service update validation
- Find services by ID or URL match when updating

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 17:38:41 -07:00
parent e5cd8678b0
commit c49d86b0b8
3 changed files with 85 additions and 71 deletions

141
status/dist/core.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -77,7 +77,14 @@
}
}
function serviceUrl(id) { return buildServiceUrl(id); }
function serviceUrl(id) {
const svc = window.APPS?.find(a => a.id === id);
if (svc?.url) return svc.url.startsWith('http') ? svc.url : 'https://' + svc.url;
if (svc?.isExternal && svc.externalUrl) return svc.externalUrl;
const dns = SITE.dnsServers?.[id];
if (dns) return 'http://' + dns.ip + ':' + (dns.port || 5380);
return buildServiceUrl(id);
}
function el(tag, cls, txt) { const n = document.createElement(tag); if (cls) n.className = cls; if (txt) n.textContent = txt; return n; }
function buildGrid() {