working resman fertig nach UI optimierung
This commit is contained in:
+69
-18
@@ -76,6 +76,38 @@ overflow:auto;
|
||||
box-shadow:0 10px 30px rgba(0,0,0,0.3);
|
||||
border-radius:6px;
|
||||
}
|
||||
.system{
|
||||
font-size:13px;
|
||||
color:#333;
|
||||
}
|
||||
#infraView div{
|
||||
background:#fafafa;
|
||||
}
|
||||
|
||||
.ip{
|
||||
font-size:12px;
|
||||
background:#f4f4f4;
|
||||
padding:2px 6px;
|
||||
margin:2px 0;
|
||||
border-radius:4px;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.provider{
|
||||
background:#e9f2ff;
|
||||
padding:2px 8px;
|
||||
border-radius:4px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.cost{
|
||||
font-weight:bold;
|
||||
color:#0a7;
|
||||
}
|
||||
|
||||
td{
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -83,7 +115,7 @@ border-radius:6px;
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Resourcen Verwaltung</h1>
|
||||
<h1>Ressourcen Verwaltung</h1>
|
||||
|
||||
<section>
|
||||
|
||||
@@ -106,7 +138,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
|
||||
<section>
|
||||
|
||||
<h2>Active Resourcen</h2>
|
||||
<h2>Active Ressourcen</h2>
|
||||
|
||||
<button onclick="openCreate()">Neue Resource</button>
|
||||
|
||||
@@ -117,10 +149,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
<th>Name</th>
|
||||
<th>Produkt</th>
|
||||
<th>Provider</th>
|
||||
<th>CPU</th>
|
||||
<th>RAM</th>
|
||||
<th>Disk</th>
|
||||
<th>OS</th>
|
||||
<th>System</th>
|
||||
<th>Domains</th>
|
||||
<th>IPs</th>
|
||||
<th>Aktionen</th>
|
||||
@@ -259,7 +288,8 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
|
||||
<br><br>
|
||||
|
||||
<button onclick="saveResource()">Save</button> <button onclick="closeModal()">Cancel</button>
|
||||
<button onclick="saveResource()">Speichern</button>
|
||||
<button onclick="closeModal()">Abbrechen</button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -333,14 +363,15 @@ let ips=""
|
||||
if(Array.isArray(r.ips)){
|
||||
|
||||
ips=r.ips.map(ip=>`
|
||||
<span class="ip">${ip.ip}</span>
|
||||
<span class="ip">${ip.type || ""} ${ip.ip}</span>
|
||||
`).join("")
|
||||
|
||||
|
||||
}
|
||||
|
||||
let domains=mappings
|
||||
.filter(m=>m.resource_id==r.id)
|
||||
.map(m=>`<div>${m.domain_name}</div>`)
|
||||
.map(m=>`<span class="ip">🌐 ${m.domain_name}</span>`)
|
||||
.join("")
|
||||
|
||||
|
||||
@@ -350,11 +381,17 @@ tr.innerHTML=`
|
||||
|
||||
<td>${r.name}</td>
|
||||
<td>${r.produkt||""}</td>
|
||||
<td>${r.provider||""}</td>
|
||||
<td>${r.cpu||""}</td>
|
||||
<td>${r.ram||""}</td>
|
||||
<td>${r.disk||""}</td>
|
||||
<td>${r.os||""}</td>
|
||||
<td><span class="provider">${r.provider || ""}</span></td>
|
||||
<td>
|
||||
<div class="system">
|
||||
|
||||
${r.cpu ? r.cpu + " CPU" : ""}
|
||||
${r.ram ? " • " + r.ram + " RAM" : ""}
|
||||
${r.disk ? " • " + r.disk : ""}
|
||||
${r.os ? " • " + r.os : ""}
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td>${domains}</td>
|
||||
<td>
|
||||
${ips}
|
||||
@@ -396,7 +433,7 @@ tr.innerHTML=`
|
||||
|
||||
<td>${r.name}</td>
|
||||
<td>${r.produkt||""}</td>
|
||||
<td>${r.provider||""}</td>
|
||||
<td><span class="provider">${r.provider || ""}</span></td>
|
||||
<td>${r.cpu||""}</td>
|
||||
<td>${r.ram||""}</td>
|
||||
<td>${r.disk||""}</td>
|
||||
@@ -621,7 +658,7 @@ const tr=document.createElement("tr")
|
||||
tr.innerHTML=`
|
||||
|
||||
<td>${d.domain_name}</td>
|
||||
<td>${d.provider||""}</td>
|
||||
<td><span class="provider">${d.provider || ""}</span></td>
|
||||
<td>${d.ip_address||""}</td>
|
||||
<td>
|
||||
|
||||
@@ -786,11 +823,25 @@ let domainYear=0
|
||||
|
||||
resources.forEach(r=>{
|
||||
|
||||
month+=Number(r.kosten_monat||0)
|
||||
year+=Number(r.kosten_jahr||0)
|
||||
let m = Number(r.kosten_monat || 0)
|
||||
let y = Number(r.kosten_jahr || 0)
|
||||
|
||||
if(m){
|
||||
month += m
|
||||
}else if(y){
|
||||
month += y / 12
|
||||
}
|
||||
|
||||
if(y){
|
||||
year += y
|
||||
}else if(m){
|
||||
year += m * 12
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
domains.forEach(d=>{
|
||||
domainYear+=Number(d.yearly_cost||0)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user