onload=function(){dockerInfo(),systemUptime(),systemLoad()},setInterval((function(){dockerInfo(),systemUptime(),systemLoad(),console.log("Updated")}),1e3);const api="https://glances.woodburn.au/api/3/";function dockerInfo(){fetch(api+"docker").then((e=>e.json())).then((e=>{let n=[],t=[];for(let o=0;o";o+="Running Containers: "+n.length+"
",o+="Stopped Containers: "+t.length+"

",document.getElementById("containers").innerHTML=o})).catch((e=>console.log(e)))}function systemUptime(){fetch(api+"uptime").then((e=>e.text())).then((e=>{let n=e.replace(/['"]+/g,"");document.getElementById("uptime").innerHTML=n})).catch((e=>console.log(e)))}function systemLoad(){fetch(api+"mem").then((e=>e.json())).then((e=>{let n=e.percent+"% RAM";document.getElementById("mem").innerHTML=n})).catch((e=>console.log(e))),fetch(api+"cpu").then((e=>e.json())).then((e=>{let n=e.total+"% CPU";document.getElementById("cpu").innerHTML=n})).catch((e=>console.log(e))),fetch(api+"fs").then((e=>e.json())).then((e=>{let n=e[0].percent+"% Disk",t=e[0].free;t/=1e9,t=t.toFixed(2),n+="
"+t+" GB Free",document.getElementById("disk").innerHTML=n})).catch((e=>console.log(e)))}