ResMan stabil: mit Serverdetail

This commit is contained in:
ecki
2026-03-07 17:52:03 +01:00
parent 6d408b9086
commit 47c95ad539
+89 -1
View File
@@ -355,6 +355,19 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
</div>
<div id="serverDetailModal" class="modal">
<h3>Server Details</h3>
<div id="serverDetailContent"></div>
<br>
<button onclick="closeServerDetail()">Schließen</button>
</div>
<script>
const API="/resman/api"
@@ -395,7 +408,12 @@ const tr=document.createElement("tr")
tr.innerHTML=`
<td>${r.name}</td>
<td>
<span style="cursor:pointer;color:#1e3a8a;font-weight:bold"
onclick='openServerDetail(${JSON.stringify(r)})'>
${r.name}
</span>
</td>
<td>${r.produkt||""}</td>
<td><span class="provider">${r.provider || ""}</span></td>
<td>
@@ -928,7 +946,77 @@ document.getElementById("infraView").innerHTML=html
}
async function openServerDetail(resource){
const mapRes = await fetch(API+"/domainmap")
const mappings = await mapRes.json()
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 || ""}
<br><br>
<b>System</b><br>
CPU: ${resource.cpu || ""}<br>
RAM: ${resource.ram || ""}<br>
Disk: ${resource.disk || ""}<br>
OS: ${resource.os || ""}
<br><br>
<b>IPs</b><br>
`
if(Array.isArray(resource.ips)){
resource.ips.forEach(ip=>{
html += `<div class="ip">${ip.type || ""} ${ip.ip}</div>`
})
}
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>`
})
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"
}
function closeServerDetail(){
document.getElementById("serverDetailModal").style.display="none"
}
loadResources()
loadCancelled()