Skip to content

Commit 0a2ddf3

Browse files
committed
fix(api): assign mounts also by disk type
fixes #214
1 parent a446f9b commit 0a2ddf3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/api/src/dynamic-info.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ export const getDynamicServerInfo = () => {
111111
({ mount, type }) => type !== 'squashfs' && mount === '/mnt/host'
112112
) ?? sizes.find(({ mount }) => mount === '/')
113113
)?.used ?? 0;
114-
const validParts = blocks.filter(({ type }) => type === 'part');
114+
const validParts = blocks.filter(
115+
({ type }) => type === 'part' || type === 'disk'
116+
);
115117

116118
let hostFound = false;
117119

apps/view/src/utils/calculations.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export const bpsPrettyPrint = (bits: number) => {
1313
};
1414

1515
export const bytePrettyPrint = (byte: number): string => {
16-
return byte > 1024 * 1024 * 1024
16+
return byte > 1024 * 1024 * 1024 * 1024 * 10
17+
? `${(byte / 1024 / 1024 / 1024 / 1024).toFixed(1)} TiB`
18+
: byte > 1024 * 1024 * 1024
1719
? `${(byte / 1024 / 1024 / 1024).toFixed(1)} GiB`
1820
: byte > 1024 * 1024
1921
? `${(byte / 1024 / 1024).toFixed(1)} MiB`

0 commit comments

Comments
 (0)