mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
UI fixes (#11417)
* Set max width on the problems area in status bar and use unique keys so they do not duplicate * Fix possibly missing media info * Show full row of items on tablet * remove debugging logic
This commit is contained in:
parent
1133202cbd
commit
8cddfc27fb
@ -116,7 +116,7 @@ export default function Statusbar() {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex h-full items-center gap-2">
|
<div className="flex h-full items-center gap-2 max-w-[50%] overflow-x-auto no-scrollbar">
|
||||||
{Object.entries(messages).length === 0 ? (
|
{Object.entries(messages).length === 0 ? (
|
||||||
<div className="flex items-center gap-2 text-sm">
|
<div className="flex items-center gap-2 text-sm">
|
||||||
<FaCheck className="size-3 text-green-500" />
|
<FaCheck className="size-3 text-green-500" />
|
||||||
@ -125,11 +125,11 @@ export default function Statusbar() {
|
|||||||
) : (
|
) : (
|
||||||
Object.entries(messages).map(([key, messageArray]) => (
|
Object.entries(messages).map(([key, messageArray]) => (
|
||||||
<div key={key} className="flex h-full items-center gap-2">
|
<div key={key} className="flex h-full items-center gap-2">
|
||||||
{messageArray.map(({ id, text, color, link }: StatusMessage) => {
|
{messageArray.map(({ text, color, link }: StatusMessage) => {
|
||||||
const message = (
|
const message = (
|
||||||
<div
|
<div
|
||||||
key={id}
|
key={text}
|
||||||
className={`flex items-center gap-2 text-sm ${link ? "cursor-pointer hover:underline" : ""}`}
|
className={`flex items-center gap-2 text-sm whitespace-nowrap ${link ? "cursor-pointer hover:underline" : ""}`}
|
||||||
>
|
>
|
||||||
<IoIosWarning
|
<IoIosWarning
|
||||||
className={`size-5 ${color || "text-danger"}`}
|
className={`size-5 ${color || "text-danger"}`}
|
||||||
@ -140,7 +140,7 @@ export default function Statusbar() {
|
|||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
return (
|
return (
|
||||||
<Link key={id} to={link}>
|
<Link key={text} to={link}>
|
||||||
{message}
|
{message}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
@ -51,7 +51,7 @@ export default function useStats(stats: FrigateStats | undefined) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.cameras[name].enabled && cam["camera_fps"] == 0) {
|
if (config.cameras[name].enabled && (cam["camera_fps"] == 0)) {
|
||||||
problems.push({
|
problems.push({
|
||||||
text: `${capitalizeFirstLetter(name.replaceAll("_", " "))} is offline`,
|
text: `${capitalizeFirstLetter(name.replaceAll("_", " "))} is offline`,
|
||||||
color: "text-danger",
|
color: "text-danger",
|
||||||
|
@ -10,8 +10,8 @@ type LiveProducerMetadata = {
|
|||||||
remote_addr: string;
|
remote_addr: string;
|
||||||
user_agent: string;
|
user_agent: string;
|
||||||
sdp: string;
|
sdp: string;
|
||||||
medias: string[];
|
medias?: string[];
|
||||||
receivers: string[];
|
receivers?: string[];
|
||||||
recv: number;
|
recv: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ type LiveConsumerMetadata = {
|
|||||||
remote_addr: string;
|
remote_addr: string;
|
||||||
user_agent: string;
|
user_agent: string;
|
||||||
sdp: string;
|
sdp: string;
|
||||||
medias: string[];
|
medias?: string[];
|
||||||
senders: string[];
|
senders?: string[];
|
||||||
send: number;
|
send: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import {
|
|||||||
isIOS,
|
isIOS,
|
||||||
isMobile,
|
isMobile,
|
||||||
isSafari,
|
isSafari,
|
||||||
|
isTablet,
|
||||||
useMobileOrientation,
|
useMobileOrientation,
|
||||||
} from "react-device-detect";
|
} from "react-device-detect";
|
||||||
import { BsThreeDotsVertical } from "react-icons/bs";
|
import { BsThreeDotsVertical } from "react-icons/bs";
|
||||||
@ -100,7 +101,7 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
|||||||
return (
|
return (
|
||||||
cameraMetadata.producers.find(
|
cameraMetadata.producers.find(
|
||||||
(prod) =>
|
(prod) =>
|
||||||
prod.medias.find((media) => media.includes("audio, sendonly")) != undefined,
|
prod.medias && prod.medias.find((media) => media.includes("audio, sendonly")) != undefined,
|
||||||
) != undefined
|
) != undefined
|
||||||
);
|
);
|
||||||
}, [cameraMetadata]);
|
}, [cameraMetadata]);
|
||||||
@ -112,7 +113,7 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
|||||||
return (
|
return (
|
||||||
cameraMetadata.producers.find(
|
cameraMetadata.producers.find(
|
||||||
(prod) =>
|
(prod) =>
|
||||||
prod.medias.find((media) => media.includes("audio, recvonly")) != undefined,
|
prod.medias && prod.medias.find((media) => media.includes("audio, recvonly")) != undefined,
|
||||||
) != undefined
|
) != undefined
|
||||||
);
|
);
|
||||||
}, [cameraMetadata])
|
}, [cameraMetadata])
|
||||||
@ -622,7 +623,7 @@ function FrigateCameraFeatures({
|
|||||||
useAutotrackingState(camera);
|
useAutotrackingState(camera);
|
||||||
|
|
||||||
// desktop shows icons part of row
|
// desktop shows icons part of row
|
||||||
if (isDesktop) {
|
if (isDesktop || isTablet) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CameraFeatureToggle
|
<CameraFeatureToggle
|
||||||
|
Loading…
Reference in New Issue
Block a user