forked from Github/frigate
Add camera bandwidth back in storage metrics (#13436)
This commit is contained in:
@@ -1,14 +1,7 @@
|
||||
import { useTheme } from "@/context/theme-provider";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import Chart from "react-apexcharts";
|
||||
|
||||
const getUnitSize = (MB: number) => {
|
||||
if (MB === null || isNaN(MB) || MB < 0) return "Invalid number";
|
||||
if (MB < 1024) return `${MB.toFixed(2)} MiB`;
|
||||
if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`;
|
||||
|
||||
return `${(MB / 1048576).toFixed(2)} TiB`;
|
||||
};
|
||||
import { getUnitSize } from "@/utils/storageUtil";
|
||||
|
||||
type StorageGraphProps = {
|
||||
graphId: string;
|
||||
|
||||
Reference in New Issue
Block a user