ResMan update
This commit is contained in:
@@ -93,3 +93,8 @@ input, textarea {
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
border-radius: 6px;
|
||||
}
|
||||
.subdomain{
|
||||
margin-left:15px;
|
||||
font-size:13px;
|
||||
color:#555;
|
||||
}
|
||||
|
||||
+40
-4
@@ -84,9 +84,8 @@ async function loadResources(){
|
||||
|
||||
async function loadDomains(){
|
||||
|
||||
console.count("loadDomains")
|
||||
|
||||
const domains = await api(API + "/domains")
|
||||
const subs = await api(API + "/subdomains")
|
||||
|
||||
const table = document.getElementById("domains")
|
||||
table.innerHTML = ""
|
||||
@@ -97,7 +96,26 @@ const tr = document.createElement("tr")
|
||||
|
||||
tr.innerHTML = `
|
||||
|
||||
<td>${d.domain_name}</td> <td> <span class="provider">${d.provider || ""}</span> </td> <td>${d.ip_address || ""}</td> <td id="server-${d.id}"> ${d.resource_name ? d.resource_name : "<span style='color:red'>⚠ no server</span>"} </td> <td id="dns-${d.id}">...</td> <td>${d.yearly_cost || ""}</td> <td> <button onclick='openDomainEdit(${JSON.stringify(d)})'>Edit</button> <button onclick="deleteDomain(${d.id})">Delete</button> </td> `
|
||||
<td>
|
||||
|
||||
${d.domain_name}
|
||||
|
||||
|
||||
${
|
||||
subs
|
||||
.filter(s => s.domain_id === d.id)
|
||||
.map(s => `<div style="margin-left:15px;color:#555">↳ ${s.subdomain}.${s.domain_name}</div>`)
|
||||
.join("")
|
||||
}
|
||||
|
||||
</td>
|
||||
|
||||
<span class="provider">${d.provider || ""}</span> </td>
|
||||
<td>${d.ip_address || ""}</td>
|
||||
<td id="server-${d.id}"> ${d.resource_name ? d.resource_name : "<span style='color:red'>⚠ no server</span>"} </td>
|
||||
<td id="dns-${d.id}">...</td>
|
||||
<td>${d.yearly_cost || ""}</td>
|
||||
<td> <button onclick='openDomainEdit(${JSON.stringify(d)})'>Edit</button> <button onclick="deleteDomain(${d.id})">Delete</button> </td> `
|
||||
|
||||
table.appendChild(tr)
|
||||
|
||||
@@ -658,9 +676,27 @@ html += `
|
||||
${resource.bemerkung || ""}
|
||||
|
||||
`
|
||||
const subs = await api(API + "/subdomains")
|
||||
|
||||
html += "<br><b>Subdomains</b><br>"
|
||||
|
||||
if(Array.isArray(resource.ips)){
|
||||
|
||||
subs.forEach(s => {
|
||||
|
||||
const match = resource.ips.find(ip => ip.ip === s.ip_address)
|
||||
|
||||
if(match){
|
||||
html += `<div class="ip">🌐 ${s.subdomain}.${s.domain_name}</div>`
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/* jetzt erst rendern */
|
||||
|
||||
document.getElementById("serverDetailContent").innerHTML = html
|
||||
|
||||
document.getElementById("serverDetailModal").style.display="block"
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user