Skip to content

Commit

Permalink
Update server.html
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro authored Feb 10, 2024
1 parent 2c0b44d commit 488a0ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1 id="name">Name</h1>
<a id="uop" target="_blank" style="color:#fff;text-decoration:none;"><label id="url">URL<br>IP</label></a>
<label id="up">Uptime:<br>0s</label>
</div>
<div id="files"></div>
<script>
const params = new URLSearchParams(window.location.search);
PT('servers/'+params.get('id'), function(s){
Expand All @@ -62,11 +63,18 @@ <h1 id="name">Name</h1>
document.getElementById('ram').innerHTML = `RAM:<br>${formatBytes(d.resources.memory_bytes)}/${s.limits.memory == 0 ? '∞' : formatBytes(s.limits.memory)}`;
document.getElementById('disk').innerHTML = `Disk:<br>${formatBytes(d.resources.disk_bytes)}/${s.limits.disk == 0 ? '∞' : formatBytes(s.limits.disk)}`;
document.getElementById('up').innerHTML = 'Uptime:<br>'+time_gud(Math.floor(d.resources.uptime/1000));
})
})
})
function power(ac) {
PT('servers/'+params.get('id')+'/power', function(){return}, 'POST', `{"signal": "${ac}"}`)
}
PT('servers/'+params.get('id')+'/files/list', function(f){
f = f.data;
document.getElementById('disk').innerHTML = f.map(o => {
o = o.attributes;
return JSON.stringify(o)
}).join('')
})
</script>
</body>
</html>

0 comments on commit 488a0ee

Please sign in to comment.