Also include potential swap files in the disk usage stats

This commit is contained in:
Johannes Zellner
2022-11-22 11:55:54 +01:00
parent c639559a6d
commit 35ea3b1575

View File

@@ -114,6 +114,15 @@ async function getDisks() {
disks[dfResult?.filesystem || rootDisk.filesystem].contents.push({ type: 'app', id: app.id, path: dataDir });
}
const swaps = await getSwaps();
for (const k in swaps) {
const swap = swaps[k];
if (swap.type !== 'file') continue;
const [, dfResult] = await safe(df.file(swap.name));
disks[dfResult?.filesystem || rootDisk.filesystem].contents.push({ type: 'swap', id: swap.name, path: swap.name });
}
return disks;
}