mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-26 00:27:40 +03:00
frontend
This commit is contained in:
parent
6acd003b44
commit
0a98297672
@ -91,6 +91,11 @@
|
|||||||
"tips": "This value represents the total storage used by the recordings in Frigate's database. Frigate does not track storage usage for all files on your disk.",
|
"tips": "This value represents the total storage used by the recordings in Frigate's database. Frigate does not track storage usage for all files on your disk.",
|
||||||
"earliestRecording": "Earliest recording available:"
|
"earliestRecording": "Earliest recording available:"
|
||||||
},
|
},
|
||||||
|
"shm": {
|
||||||
|
"title": "SHM (shared memory) allocation",
|
||||||
|
"warning": "The current SHM size of {{total}}MB is too small, recommend increasing to {{min_shm}}MB.",
|
||||||
|
"readTheDocumentation": "Read the documentation"
|
||||||
|
},
|
||||||
"cameraStorage": {
|
"cameraStorage": {
|
||||||
"title": "Camera Storage",
|
"title": "Camera Storage",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
|
|||||||
@ -79,6 +79,7 @@ export type StorageStats = {
|
|||||||
total: number;
|
total: number;
|
||||||
used: number;
|
used: number;
|
||||||
mount_type: string;
|
mount_type: string;
|
||||||
|
min_shm?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PotentialProblem = {
|
export type PotentialProblem = {
|
||||||
|
|||||||
@ -14,6 +14,10 @@ import { useFormattedTimestamp, useTimezone } from "@/hooks/use-date-utils";
|
|||||||
import { RecordingsSummary } from "@/types/review";
|
import { RecordingsSummary } from "@/types/review";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { TZDate } from "react-day-picker";
|
import { TZDate } from "react-day-picker";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||||
|
import { LuExternalLink } from "react-icons/lu";
|
||||||
|
import { FaExclamationTriangle } from "react-icons/fa";
|
||||||
|
|
||||||
type CameraStorage = {
|
type CameraStorage = {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
@ -36,6 +40,7 @@ export default function StorageMetrics({
|
|||||||
});
|
});
|
||||||
const { t } = useTranslation(["views/system"]);
|
const { t } = useTranslation(["views/system"]);
|
||||||
const timezone = useTimezone(config);
|
const timezone = useTimezone(config);
|
||||||
|
const { getLocaleDocUrl } = useDocDomain();
|
||||||
|
|
||||||
const totalStorage = useMemo(() => {
|
const totalStorage = useMemo(() => {
|
||||||
if (!cameraStorage || !stats) {
|
if (!cameraStorage || !stats) {
|
||||||
@ -142,7 +147,46 @@ export default function StorageMetrics({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-col rounded-lg bg-background_alt p-2.5 md:rounded-2xl">
|
<div className="flex-col rounded-lg bg-background_alt p-2.5 md:rounded-2xl">
|
||||||
<div className="mb-5">/dev/shm</div>
|
<div className="mb-5 flex flex-row items-center justify-between">
|
||||||
|
/dev/shm
|
||||||
|
{stats.service.storage["/dev/shm"]["total"] <
|
||||||
|
(stats.service.storage["/dev/shm"]["min_shm"] ?? 0) && (
|
||||||
|
<Popover>
|
||||||
|
<PopoverTrigger asChild>
|
||||||
|
<button
|
||||||
|
className="focus:outline-none"
|
||||||
|
aria-label={t("storage.shm.title")}
|
||||||
|
>
|
||||||
|
<FaExclamationTriangle
|
||||||
|
className="size-5 text-danger"
|
||||||
|
aria-label={t("storage.shm.title")}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</PopoverTrigger>
|
||||||
|
<PopoverContent className="w-80">
|
||||||
|
<div className="space-y-2">
|
||||||
|
{t("storage.shm.warning", {
|
||||||
|
total: stats.service.storage["/dev/shm"]["total"],
|
||||||
|
min_shm: stats.service.storage["/dev/shm"]["min_shm"],
|
||||||
|
})}
|
||||||
|
<div className="mt-2 flex items-center text-primary">
|
||||||
|
<Link
|
||||||
|
to={getLocaleDocUrl(
|
||||||
|
"frigate/installation#calculating-required-shm-size",
|
||||||
|
)}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="inline"
|
||||||
|
>
|
||||||
|
{t("storage.shm.readTheDocumentation")}
|
||||||
|
<LuExternalLink className="ml-2 inline-flex size-3" />
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</PopoverContent>
|
||||||
|
</Popover>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<StorageGraph
|
<StorageGraph
|
||||||
graphId="general-shared-memory"
|
graphId="general-shared-memory"
|
||||||
used={stats.service.storage["/dev/shm"]["used"]}
|
used={stats.service.storage["/dev/shm"]["used"]}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user