mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
add healthy message
This commit is contained in:
parent
37d83883c2
commit
a0eb2138f4
@ -6,6 +6,7 @@ import {
|
|||||||
import useStats from "@/hooks/use-stats";
|
import useStats from "@/hooks/use-stats";
|
||||||
import { FrigateStats } from "@/types/stats";
|
import { FrigateStats } from "@/types/stats";
|
||||||
import { useContext, useEffect, useMemo } from "react";
|
import { useContext, useEffect, useMemo } from "react";
|
||||||
|
import { FaCheck } from "react-icons/fa";
|
||||||
import { IoIosWarning } from "react-icons/io";
|
import { IoIosWarning } from "react-icons/io";
|
||||||
import { MdCircle } from "react-icons/md";
|
import { MdCircle } from "react-icons/md";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -101,16 +102,25 @@ export default function Statusbar() {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className="h-full flex items-center gap-2">
|
<div className="h-full flex items-center gap-2">
|
||||||
{Object.entries(messages).map(([key, messageArray]) => (
|
{Object.entries(messages).length === 0 ? (
|
||||||
<div key={key} className="h-full flex items-center gap-2">
|
<div className="flex items-center text-sm gap-2">
|
||||||
{messageArray.map(({ id, text, color }: StatusMessage) => (
|
<FaCheck className="size-3 text-green-500" />
|
||||||
<div key={id} className="flex items-center text-sm gap-2">
|
System is healthy
|
||||||
<IoIosWarning className={`size-5 ${color || "text-danger"}`} />
|
|
||||||
{text}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
) : (
|
||||||
|
Object.entries(messages).map(([key, messageArray]) => (
|
||||||
|
<div key={key} className="h-full flex items-center gap-2">
|
||||||
|
{messageArray.map(({ id, text, color }: StatusMessage) => (
|
||||||
|
<div key={id} className="flex items-center text-sm gap-2">
|
||||||
|
<IoIosWarning
|
||||||
|
className={`size-5 ${color || "text-danger"}`}
|
||||||
|
/>
|
||||||
|
{text}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user