minor change to user data

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-20 21:38:47 +00:00
parent 41c3ba3dd3
commit 6fd6d06978

View File

@ -25,16 +25,16 @@ function buildResourceTable (object, tableid) {
if (object instanceof Object) { if (object instanceof Object) {
let table = document.querySelector(tableid); let table = document.querySelector(tableid);
let tbody = table.querySelector("tbody"); let tbody = table.querySelector("tbody");
Object.keys(object.avail).forEach((element) => { Object.keys(object.resources.avail).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 used = row.insertCell(); let used = row.insertCell();
used.innerText = `${parseNumber(object.used[element], object.units[element])}`; used.innerText = `${parseNumber(object.resources.used[element], object.resources.units[element])}`;
let val = row.insertCell(); let val = row.insertCell();
val.innerText = `${parseNumber(object.avail[element], object.units[element])}`; val.innerText = `${parseNumber(object.resources.avail[element], object.resources.units[element])}`;
let total = row.insertCell(); let total = row.insertCell();
total.innerText = `${parseNumber(object.max[element], object.units[element])}`; total.innerText = `${parseNumber(object.resources.max[element], object.resources.units[element])}`;
}); });
} }
} }