add proper account resource usage functionality

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-11 18:01:06 +00:00
parent cabea750db
commit 729f8c0faa
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@
* { * {
font-family: monospace; font-family: monospace;
font-size: large; font-size: large;
box-sizing: border-box;
} }
body { body {

View File

@ -13,14 +13,14 @@ function buildResourceTable (object, tableid) {
let table = document.querySelector(tableid); let table = document.querySelector(tableid);
let tbody = table.querySelector("tbody"); let tbody = table.querySelector("tbody");
Object.keys(object).forEach((element) => { Object.keys(object.available).forEach((element) => {
let row = tbody.insertRow(); let row = tbody.insertRow();
let key = row.insertCell(); let key = row.insertCell();
key.innerText = `${element}`; key.innerText = `${element}`;
let val = row.insertCell(); let val = row.insertCell();
val.innerText = `${object[element]}` val.innerText = `${object.available[element]}`
let total = row.insertCell();; let total = row.insertCell();;
total.innerText = `${object[element]}` total.innerText = `${object.maximum[element]}`
}); });
} }
} }