feature: DNS cache + subdomain CRUD + domains cleanup

This commit is contained in:
ecki
2026-03-27 11:31:42 +01:00
parent 49ae3a5c29
commit 0329c67904
4 changed files with 372 additions and 228 deletions
+67 -9
View File
@@ -57,25 +57,83 @@ document.getElementById("resourceModal").style.display="none"
}
window.openServerDetail = async function(resource){
const mappings = await api(API+"/domainmap")
const mappings = await api(API+"/domainmap")
const subs = await api(API+"/subdomains")
let html = `<b>${resource.name}</b><br><br>`
let html = `
<b>Name:</b> ${resource.name}<br>
<b>Produkt:</b> ${resource.produkt || ""}<br>
<b>Provider:</b> ${resource.provider || ""}<br>
<b>Provider Name:</b> ${resource.providername || ""}
const domains = mappings.filter(m => m.resource_id == resource.id)
<br><br>
domains.forEach(d=>{
html += `<div class="ip">🌐 ${d.domain_name}</div>`
})
<b>System</b><br>
CPU: ${resource.cpu || ""}<br>
RAM: ${resource.ram || ""}<br>
Disk: ${resource.disk || ""}<br>
OS: ${resource.os || ""}
document.getElementById("serverDetailContent").innerHTML = html
document.getElementById("serverDetailModal").style.display="block"
<br><br>
<b>IPs</b><br>
`
// IPs
if(Array.isArray(resource.ips)){
resource.ips.forEach(ip=>{
html += `<div class="ip">${ip.type || ""} ${ip.ip}</div>`
})
}
// Domains
html += `<br><b>Domains</b><br>`
const domains = mappings.filter(m => m.resource_id == resource.id)
domains.forEach(d=>{
html += `<div class="ip">🌐 ${d.domain_name}</div>`
// Subdomains dazu
subs.forEach(s => {
if(s.domain_name === d.domain_name){
html += `
<div class="subdomain-detail">
${s.subdomain}.${s.domain_name}
</div>
`
}
})
})
// Zusatzinfos
html += `
<br>
<b>Bestelldatum:</b> ${resource.bestelldatum || ""}<br>
<b>Kündbar ab:</b> ${resource.kuendbar_ab || ""}
<br><br>
<b>Bemerkung</b><br>
${resource.bemerkung || ""}
`
document.getElementById("serverDetailContent").innerHTML = html
document.getElementById("serverDetailModal").style.display="block"
}
window.closeServerDetail = function(){
document.getElementById("serverDetailModal").style.display="none"