From 37b021ec0075c65874ffdb7dce85d8c2e5a648d0 Mon Sep 17 00:00:00 2001 From: aliceif <7098860+aliceif@users.noreply.github.com> Date: Sat, 14 Sep 2024 09:26:29 +0200 Subject: [PATCH] use sum of file system sizes instead of first to avoid problems with boot partitions at first index --- .../backend/src/server/api/endpoints/admin/server-info.ts | 4 ++-- packages/backend/src/server/api/endpoints/server-info.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index 80b6a4d32e01..ef64b69b3aa6 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -134,8 +134,8 @@ export default class extends Endpoint { // eslint- total: memStats.total, }, fs: { - total: fsStats[0].size, - used: fsStats[0].used, + total: fsStats.map(fs => fs.size).reduce((acc, size) => acc + size), + used: fsStats.map(fs => fs.used).reduce((acc, size) => acc + size), }, net: { interface: netInterface, diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 8301c85f2eb6..16d0e3417edd 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -106,8 +106,8 @@ export default class extends Endpoint { // eslint- total: memStats.total, }, fs: { - total: fsStats[0].size, - used: fsStats[0].used, + total: fsStats.map(fs => fs.size).reduce((acc, size) => acc + size), + used: fsStats.map(fs => fs.used).reduce((acc, size) => acc + size), }, }; });