mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Refactor storage unit size display to use binary prefixes
This commit updates the display of storage unit sizes in both the camera storage stats and the Storage component in the web UI to use binary prefixes (MiB and GiB) instead of decimal prefixes (MB and GB). This provides more accurate and consistent representation of storage sizes
This commit is contained in:
parent
5116f92c21
commit
72b3712d64
@ -56,7 +56,7 @@ class StorageMaintainer(threading.Thread):
|
|||||||
bandwidth = 0
|
bandwidth = 0
|
||||||
|
|
||||||
self.camera_storage_stats[camera]["bandwidth"] = bandwidth
|
self.camera_storage_stats[camera]["bandwidth"] = bandwidth
|
||||||
logger.debug(f"{camera} has a bandwidth of {bandwidth} MB/hr.")
|
logger.debug(f"{camera} has a bandwidth of {bandwidth} MiB/hr.")
|
||||||
|
|
||||||
def calculate_camera_usages(self) -> dict[str, dict]:
|
def calculate_camera_usages(self) -> dict[str, dict]:
|
||||||
"""Calculate the storage usage of each camera."""
|
"""Calculate the storage usage of each camera."""
|
||||||
|
|||||||
@ -26,9 +26,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} MB`;
|
if (MB < 1024) return `${MB} MiB`;
|
||||||
|
|
||||||
return `${(MB / 1024).toFixed(2)} GB`;
|
return `${(MB / 1024).toFixed(2)} GiB`;
|
||||||
};
|
};
|
||||||
|
|
||||||
let storage_usage;
|
let storage_usage;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user