mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Support TiB in storage calculation (#8142)
This commit is contained in:
parent
dcafcc1320
commit
2379e6fd1b
@ -27,8 +27,9 @@ export default function Storage() {
|
|||||||
const getUnitSize = (MB) => {
|
const getUnitSize = (MB) => {
|
||||||
if (isNaN(MB) || MB < 0) return 'Invalid number';
|
if (isNaN(MB) || MB < 0) return 'Invalid number';
|
||||||
if (MB < 1024) return `${MB} MiB`;
|
if (MB < 1024) return `${MB} MiB`;
|
||||||
|
if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`;
|
||||||
|
|
||||||
return `${(MB / 1024).toFixed(2)} GiB`;
|
return `${(MB / 1048576).toFixed(2)} TiB`;
|
||||||
};
|
};
|
||||||
|
|
||||||
let storage_usage;
|
let storage_usage;
|
||||||
|
Loading…
Reference in New Issue
Block a user