+
Active Resources
@@ -102,6 +120,7 @@ border-radius:6px;
RAM |
Disk |
OS |
+Domains |
IPs |
Actions |
@@ -290,6 +309,9 @@ async function loadResources(){
const res=await fetch(API+"/resources/active")
const data=await res.json()
+const mapRes=await fetch(API+"/domainmap")
+const mappings=await mapRes.json()
+
const table=document.getElementById("resources")
table.innerHTML=""
@@ -306,6 +328,12 @@ ips=r.ips.map(ip=>`
}
+let domains=mappings
+.filter(m=>m.resource_id==r.id)
+.map(m=>`${m.domain_name}
`)
+.join("")
+
+
const tr=document.createElement("tr")
tr.innerHTML=`
@@ -317,7 +345,7 @@ tr.innerHTML=`
${r.ram||""} |
${r.disk||""} |
${r.os||""} |
-
+${domains} |
${ips}
@@ -585,7 +613,13 @@ tr.innerHTML=`
| ${d.domain_name} |
${d.provider||""} |
${d.ip_address||""} |
-${d.resource_name||""} |
+
+
+${d.resource_name ?
+d.resource_name :
+"⚠ no server"}
+
+ |
${d.yearly_cost||""} |
@@ -728,12 +762,44 @@ table.appendChild(tr)
}
+async function loadCosts(){
+
+const res=await fetch(API+"/resources/active")
+const resources=await res.json()
+
+const domRes=await fetch(API+"/domains")
+const domains=await domRes.json()
+
+let month=0
+let year=0
+let domainYear=0
+
+resources.forEach(r=>{
+
+month+=Number(r.kosten_monat||0)
+year+=Number(r.kosten_jahr||0)
+
+})
+
+domains.forEach(d=>{
+domainYear+=Number(d.yearly_cost||0)
+})
+
+document.getElementById("costMonth").innerText=month.toFixed(2)
+document.getElementById("costYear").innerText=year.toFixed(2)
+document.getElementById("costDomain").innerText=domainYear.toFixed(2)
+
+document.getElementById("costTotal").innerText=(year+domainYear).toFixed(2)
+
+}
+
loadResources()
loadCancelled()
loadDomains()
loadMapping()
+loadCosts()
diff --git a/backend/public/index.sav b/backend/public/index.sav
new file mode 100644
index 0000000..b327fde
--- /dev/null
+++ b/backend/public/index.sav
@@ -0,0 +1,741 @@
+
+
+
+
+
+ResMan
+
+
+
+
+
+
+
+Resource Manager
+
+
+
+Active Resources
+
+
+
+
+
+
+
+| Name |
+Produkt |
+Provider |
+CPU |
+RAM |
+Disk |
+OS |
+IPs |
+Actions |
+
+
+
+
+
+
+
+
+
+
+
+Domains
+
+
+
+
+
+
+
+| Domain |
+Provider |
+IP |
+Server |
+Cost/Y |
+Actions |
+
+
+
+
+
+
+
+
+
+
+
+Domain → Server Mapping
+
+
+
+
+
+| Domain |
+IP |
+Server |
+
+
+
+
+
+
+
+
+
+
+
+Cancelled Resources
+
+
+
+
+
+| Name |
+Produkt |
+Provider |
+CPU |
+RAM |
+Disk |
+Status |
+
+
+
+
+
+
+
+
+
+
+
+ Resource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IP Manager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Domain
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|