High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(web): storage decimals (#5363)
Jason Rasmussen9483c456d416
diff --git a/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte b/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelteindex a4f5274454..aabb86d88a 100644--- a/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte+++ b/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte@@ -21,7 +21,8 @@return '0'.repeat(zeroLength);};- $: [statsUsage, statsUsageUnit] = getBytesWithUnit(stats.usage, 0);+ const TiB = 1024 ** 4;+ $: [statsUsage, statsUsageUnit] = getBytesWithUnit(stats.usage, stats.usage > TiB ? 2 : 0);</script><div class="flex flex-col gap-5">diff --git a/web/src/lib/utils/byte-units.ts b/web/src/lib/utils/byte-units.tsindex 97afe1285e..4a41a23bc5 100644--- a/web/src/lib/utils/byte-units.ts+++ b/web/src/lib/utils/byte-units.ts@@ -9,7 +9,7 @@* @returns size (number) and unit (string)*/export function getBytesWithUnit(bytes: number, maxPrecision = 1): [number, string] {- const units = ['B', 'KiB', 'MiB', 'GiB'];+ const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];let magnitude = 0;let remainder = bytes;