From 35ea3b15755387d91b8f0abd15f2d7de4914cbbd Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 22 Nov 2022 11:55:54 +0100 Subject: [PATCH] Also include potential swap files in the disk usage stats --- src/system.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system.js b/src/system.js index 89ebb014f..620255695 100644 --- a/src/system.js +++ b/src/system.js @@ -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; }