Skip to content

Commit

Permalink
fix(api): assign mounts also by disk type
Browse files Browse the repository at this point in the history
fixes #214
  • Loading branch information
MauriceNino committed Jul 18, 2022
1 parent a446f9b commit 0a2ddf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/api/src/dynamic-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export const getDynamicServerInfo = () => {
({ mount, type }) => type !== 'squashfs' && mount === '/mnt/host'
) ?? sizes.find(({ mount }) => mount === '/')
)?.used ?? 0;
const validParts = blocks.filter(({ type }) => type === 'part');
const validParts = blocks.filter(
({ type }) => type === 'part' || type === 'disk'
);

let hostFound = false;

Expand Down
4 changes: 3 additions & 1 deletion apps/view/src/utils/calculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const bpsPrettyPrint = (bits: number) => {
};

export const bytePrettyPrint = (byte: number): string => {
return byte > 1024 * 1024 * 1024
return byte > 1024 * 1024 * 1024 * 1024 * 10
? `${(byte / 1024 / 1024 / 1024 / 1024).toFixed(1)} TiB`
: byte > 1024 * 1024 * 1024
? `${(byte / 1024 / 1024 / 1024).toFixed(1)} GiB`
: byte > 1024 * 1024
? `${(byte / 1024 / 1024).toFixed(1)} MiB`
Expand Down

0 comments on commit 0a2ddf3

Please sign in to comment.