Use top-level dataset info
This commit is contained in:
parent
b5eae499ec
commit
d2cb64c7a3
@ -36,13 +36,13 @@ export default function Component({ service }) {
|
|||||||
|
|
||||||
if (showPools) {
|
if (showPools) {
|
||||||
pools = poolsData.map((pool) => {
|
pools = poolsData.map((pool) => {
|
||||||
const dataset = datasetData.find((d) => d.pool === pool.name);
|
const dataset = datasetData.find((d) => d.pool === pool.name && d.name === pool.name);
|
||||||
return {
|
return {
|
||||||
id: pool.id,
|
id: pool.id,
|
||||||
name: pool.name,
|
name: pool.name,
|
||||||
healthy: pool.healthy,
|
healthy: pool.healthy,
|
||||||
allocated: dataset.children.reduce((acc, d) => acc + parseInt(d.used.rawvalue, 10), 0),
|
allocated: dataset?.used.parsed ?? 0,
|
||||||
free: dataset.children.reduce((acc, d) => acc + parseInt(d.available.rawvalue, 10), 0),
|
free: dataset?.available.parsed ?? 0,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user