mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-25 21:29:01 +03:00
Miscellaneous fixes (#23394)
* serialize OpenVINO inference per process to prevent concurrent-inference segfault * clean up * add max scaling meta to login page * add more detect section field messages * fix icon layout in settings field messages * tweak edit icon color
This commit is contained in:
@@ -15,13 +15,13 @@ const severityVariantMap: Record<
|
||||
function SeverityIcon({ severity }: { severity: string }) {
|
||||
switch (severity) {
|
||||
case "info":
|
||||
return <LuInfo className="size-4" />;
|
||||
return <LuInfo className="size-4 shrink-0" />;
|
||||
case "warning":
|
||||
return <LuTriangleAlert className="size-4" />;
|
||||
return <LuTriangleAlert className="size-4 shrink-0" />;
|
||||
case "error":
|
||||
return <LuCircleAlert className="size-4" />;
|
||||
return <LuCircleAlert className="size-4 shrink-0" />;
|
||||
default:
|
||||
return <LuInfo className="size-4" />;
|
||||
return <LuInfo className="size-4 shrink-0" />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ const severityVariantMap: Record<
|
||||
function SeverityIcon({ severity }: { severity: MessageSeverity }) {
|
||||
switch (severity) {
|
||||
case "info":
|
||||
return <LuInfo className="size-4" />;
|
||||
return <LuInfo className="size-4 shrink-0" />;
|
||||
case "warning":
|
||||
return <LuTriangleAlert className="size-4" />;
|
||||
return <LuTriangleAlert className="size-4 shrink-0" />;
|
||||
case "error":
|
||||
return <LuCircleAlert className="size-4" />;
|
||||
return <LuCircleAlert className="size-4 shrink-0" />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,12 @@ const detect: SectionConfigOverrides = {
|
||||
condition: (ctx) =>
|
||||
ctx.level === "camera" && ctx.formData?.enabled === false,
|
||||
},
|
||||
],
|
||||
fieldMessages: [
|
||||
{
|
||||
key: "detect-resolution-not-multiple-of-four",
|
||||
field: "width",
|
||||
position: "before",
|
||||
messageKey: "configMessages.detect.resolutionShouldBeMultipleOfFour",
|
||||
severity: "warning",
|
||||
condition: (ctx) => {
|
||||
@@ -23,8 +27,59 @@ const detect: SectionConfigOverrides = {
|
||||
return isEvenButNotFour(width) || isEvenButNotFour(height);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "detect-global-resolution-multiple-cameras",
|
||||
field: "width",
|
||||
position: "before",
|
||||
messageKey: "configMessages.detect.globalResolutionMultipleCameras",
|
||||
severity: "info",
|
||||
condition: (ctx) => {
|
||||
if (ctx.level !== "global") return false;
|
||||
const width = ctx.formData?.width as number | null | undefined;
|
||||
const height = ctx.formData?.height as number | null | undefined;
|
||||
if (typeof width !== "number" && typeof height !== "number") {
|
||||
return false;
|
||||
}
|
||||
const cameraCount = Object.keys(ctx.fullConfig?.cameras ?? {}).length;
|
||||
return cameraCount > 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "detect-resolution-high",
|
||||
field: "width",
|
||||
position: "before",
|
||||
messageKey: "configMessages.detect.resolutionHigh",
|
||||
severity: "warning",
|
||||
condition: (ctx) => {
|
||||
const width = ctx.formData?.width as number | null | undefined;
|
||||
const height = ctx.formData?.height as number | null | undefined;
|
||||
if (typeof width !== "number" || typeof height !== "number") {
|
||||
return false;
|
||||
}
|
||||
return Math.min(width, height) > 1080;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "detect-square-resolution",
|
||||
field: "width",
|
||||
position: "before",
|
||||
messageKey: "configMessages.detect.squareResolution",
|
||||
severity: "warning",
|
||||
condition: (ctx) => {
|
||||
const width = ctx.formData?.width as number | null | undefined;
|
||||
const height = ctx.formData?.height as number | null | undefined;
|
||||
return (
|
||||
typeof width === "number" &&
|
||||
typeof height === "number" &&
|
||||
width > 0 &&
|
||||
width === height
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "detect-aspect-ratio-mismatch",
|
||||
field: "width",
|
||||
position: "before",
|
||||
messageKey: "configMessages.detect.aspectRatioMismatch",
|
||||
severity: "warning",
|
||||
condition: (ctx) => {
|
||||
@@ -55,8 +110,6 @@ const detect: SectionConfigOverrides = {
|
||||
return Math.abs(newRatio - savedRatio) > 0.01;
|
||||
},
|
||||
},
|
||||
],
|
||||
fieldMessages: [
|
||||
{
|
||||
key: "fps-greater-than-five",
|
||||
field: "fps",
|
||||
@@ -71,6 +124,31 @@ const detect: SectionConfigOverrides = {
|
||||
return detectFps != null && streamFps != null && detectFps > 5;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "max-frames-set",
|
||||
field: "stationary.max_frames",
|
||||
messageKey: "configMessages.detect.maxFramesSet",
|
||||
severity: "warning",
|
||||
position: "after",
|
||||
condition: (ctx) => {
|
||||
const stationary = ctx.formData?.stationary as
|
||||
| {
|
||||
max_frames?: {
|
||||
default?: number | null;
|
||||
objects?: Record<string, number>;
|
||||
} | null;
|
||||
}
|
||||
| null
|
||||
| undefined;
|
||||
const maxFrames = stationary?.max_frames;
|
||||
if (!maxFrames) return false;
|
||||
return (
|
||||
typeof maxFrames.default === "number" ||
|
||||
(maxFrames.objects != null &&
|
||||
Object.keys(maxFrames.objects).length > 0)
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
fieldOrder: [
|
||||
"enabled",
|
||||
@@ -81,9 +159,9 @@ const detect: SectionConfigOverrides = {
|
||||
"max_disappeared",
|
||||
"annotation_offset",
|
||||
"stationary",
|
||||
"interval",
|
||||
"threshold",
|
||||
"max_frames",
|
||||
"stationary.interval",
|
||||
"stationary.threshold",
|
||||
"stationary.max_frames",
|
||||
],
|
||||
restartRequired: [],
|
||||
fieldGroups: {
|
||||
@@ -129,9 +207,6 @@ const detect: SectionConfigOverrides = {
|
||||
"max_disappeared",
|
||||
"annotation_offset",
|
||||
"stationary",
|
||||
"interval",
|
||||
"threshold",
|
||||
"max_frames",
|
||||
],
|
||||
advancedFields: [],
|
||||
},
|
||||
|
||||
@@ -283,7 +283,7 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) {
|
||||
afterSelect?.();
|
||||
}}
|
||||
>
|
||||
<LuPencil className="size-5 text-primary" />
|
||||
<LuPencil className="size-5 text-primary-variant" />
|
||||
</Button>,
|
||||
);
|
||||
}
|
||||
@@ -376,7 +376,7 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) {
|
||||
onMouseEnter={() => showTooltip("edit")}
|
||||
onMouseLeave={() => showTooltip(undefined)}
|
||||
>
|
||||
<LuPencil className="size-4 text-primary" />
|
||||
<LuPencil className="size-4 text-primary-variant" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipPortal>
|
||||
|
||||
Reference in New Issue
Block a user