From 729f8c0faa7e09b9e5b3e4a97a877bd780e2f8ab Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 11 Apr 2023 18:01:06 +0000 Subject: [PATCH] add proper account resource usage functionality Signed-off-by: Arthur Lu --- css/style.css | 1 + scripts/account.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/css/style.css b/css/style.css index 9bc9ee0..237713a 100644 --- a/css/style.css +++ b/css/style.css @@ -15,6 +15,7 @@ * { font-family: monospace; font-size: large; + box-sizing: border-box; } body { diff --git a/scripts/account.js b/scripts/account.js index b8063ce..ce88775 100644 --- a/scripts/account.js +++ b/scripts/account.js @@ -13,14 +13,14 @@ function buildResourceTable (object, tableid) { let table = document.querySelector(tableid); let tbody = table.querySelector("tbody"); - Object.keys(object).forEach((element) => { + Object.keys(object.available).forEach((element) => { let row = tbody.insertRow(); let key = row.insertCell(); key.innerText = `${element}`; let val = row.insertCell(); - val.innerText = `${object[element]}` + val.innerText = `${object.available[element]}` let total = row.insertCell();; - total.innerText = `${object[element]}` + total.innerText = `${object.maximum[element]}` }); } } \ No newline at end of file