mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-31 04:14:53 +03:00
form tweaks
This commit is contained in:
parent
3b5b4bffb9
commit
ba1d5d42c5
@ -25,7 +25,7 @@ class AudioFilterConfig(FrigateBaseModel):
|
|||||||
class AudioConfig(FrigateBaseModel):
|
class AudioConfig(FrigateBaseModel):
|
||||||
enabled: bool = Field(
|
enabled: bool = Field(
|
||||||
default=False,
|
default=False,
|
||||||
title="Enable audio",
|
title="Enable audio detection",
|
||||||
description="Enable or disable audio event detection; can be overridden per-camera.",
|
description="Enable or disable audio event detection; can be overridden per-camera.",
|
||||||
)
|
)
|
||||||
max_not_heard: int = Field(
|
max_not_heard: int = Field(
|
||||||
|
|||||||
@ -69,12 +69,12 @@ class DetectConfig(FrigateBaseModel):
|
|||||||
)
|
)
|
||||||
min_initialized: Optional[int] = Field(
|
min_initialized: Optional[int] = Field(
|
||||||
default=None,
|
default=None,
|
||||||
title="Min initialization hits",
|
title="Minimum initialization frames",
|
||||||
description="Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2.",
|
description="Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2.",
|
||||||
)
|
)
|
||||||
max_disappeared: Optional[int] = Field(
|
max_disappeared: Optional[int] = Field(
|
||||||
default=None,
|
default=None,
|
||||||
title="Max disappeared frames",
|
title="Maximum disappeared frames",
|
||||||
description="Number of frames without a detection before a tracked object is considered gone.",
|
description="Number of frames without a detection before a tracked object is considered gone.",
|
||||||
)
|
)
|
||||||
stationary: StationaryConfig = Field(
|
stationary: StationaryConfig = Field(
|
||||||
|
|||||||
@ -124,8 +124,8 @@ class CameraInput(FrigateBaseModel):
|
|||||||
)
|
)
|
||||||
global_args: Union[str, list[str]] = Field(
|
global_args: Union[str, list[str]] = Field(
|
||||||
default_factory=list,
|
default_factory=list,
|
||||||
title="FFmpeg args",
|
title="FFmpeg global args",
|
||||||
description="FFmpeg arguments for this input stream.",
|
description="FFmpeg global arguments for this input stream.",
|
||||||
)
|
)
|
||||||
hwaccel_args: Union[str, list[str]] = Field(
|
hwaccel_args: Union[str, list[str]] = Field(
|
||||||
default_factory=list,
|
default_factory=list,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"label": "Audio events",
|
"label": "Audio events",
|
||||||
"description": "Settings for audio-based event detection; can be overridden per-camera.",
|
"description": "Settings for audio-based event detection; can be overridden per-camera.",
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Enable audio",
|
"label": "Enable audio detection",
|
||||||
"description": "Enable or disable audio event detection; can be overridden per-camera."
|
"description": "Enable or disable audio event detection; can be overridden per-camera."
|
||||||
},
|
},
|
||||||
"max_not_heard": {
|
"max_not_heard": {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
"label": "Audio events",
|
"label": "Audio events",
|
||||||
"description": "Settings for audio-based event detection; can be overridden per-camera.",
|
"description": "Settings for audio-based event detection; can be overridden per-camera.",
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Enable audio",
|
"label": "Enable audio detection",
|
||||||
"description": "Enable or disable audio event detection; can be overridden per-camera."
|
"description": "Enable or disable audio event detection; can be overridden per-camera."
|
||||||
},
|
},
|
||||||
"max_not_heard": {
|
"max_not_heard": {
|
||||||
@ -96,11 +96,11 @@
|
|||||||
"description": "Desired frames per second to run detection on; lower values reduce CPU usage (recommended value is 5, only set higher - at most 10 - if tracking extremely fast moving objects)."
|
"description": "Desired frames per second to run detection on; lower values reduce CPU usage (recommended value is 5, only set higher - at most 10 - if tracking extremely fast moving objects)."
|
||||||
},
|
},
|
||||||
"min_initialized": {
|
"min_initialized": {
|
||||||
"label": "Min initialization hits",
|
"label": "Minimum initialization frames",
|
||||||
"description": "Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2."
|
"description": "Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2."
|
||||||
},
|
},
|
||||||
"max_disappeared": {
|
"max_disappeared": {
|
||||||
"label": "Max disappeared frames",
|
"label": "Maximum disappeared frames",
|
||||||
"description": "Number of frames without a detection before a tracked object is considered gone."
|
"description": "Number of frames without a detection before a tracked object is considered gone."
|
||||||
},
|
},
|
||||||
"stationary": {
|
"stationary": {
|
||||||
@ -203,8 +203,8 @@
|
|||||||
"description": "Roles for this input stream (for example: detect, record, audio)."
|
"description": "Roles for this input stream (for example: detect, record, audio)."
|
||||||
},
|
},
|
||||||
"global_args": {
|
"global_args": {
|
||||||
"label": "FFmpeg args",
|
"label": "FFmpeg global args",
|
||||||
"description": "FFmpeg arguments for this input stream."
|
"description": "FFmpeg global arguments for this input stream."
|
||||||
},
|
},
|
||||||
"hwaccel_args": {
|
"hwaccel_args": {
|
||||||
"label": "Hardware acceleration args",
|
"label": "Hardware acceleration args",
|
||||||
|
|||||||
@ -18,11 +18,11 @@
|
|||||||
"description": "Desired frames per second to run detection on; lower values reduce CPU usage (recommended value is 5, only set higher - at most 10 - if tracking extremely fast moving objects)."
|
"description": "Desired frames per second to run detection on; lower values reduce CPU usage (recommended value is 5, only set higher - at most 10 - if tracking extremely fast moving objects)."
|
||||||
},
|
},
|
||||||
"min_initialized": {
|
"min_initialized": {
|
||||||
"label": "Min initialization hits",
|
"label": "Minimum initialization frames",
|
||||||
"description": "Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2."
|
"description": "Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2."
|
||||||
},
|
},
|
||||||
"max_disappeared": {
|
"max_disappeared": {
|
||||||
"label": "Max disappeared frames",
|
"label": "Maximum disappeared frames",
|
||||||
"description": "Number of frames without a detection before a tracked object is considered gone."
|
"description": "Number of frames without a detection before a tracked object is considered gone."
|
||||||
},
|
},
|
||||||
"stationary": {
|
"stationary": {
|
||||||
|
|||||||
@ -53,8 +53,8 @@
|
|||||||
"description": "Roles for this input stream (for example: detect, record, audio)."
|
"description": "Roles for this input stream (for example: detect, record, audio)."
|
||||||
},
|
},
|
||||||
"global_args": {
|
"global_args": {
|
||||||
"label": "FFmpeg args",
|
"label": "FFmpeg global args",
|
||||||
"description": "FFmpeg arguments for this input stream."
|
"description": "FFmpeg global arguments for this input stream."
|
||||||
},
|
},
|
||||||
"hwaccel_args": {
|
"hwaccel_args": {
|
||||||
"label": "Hardware acceleration args",
|
"label": "Hardware acceleration args",
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const AudioSection = createConfigSection({
|
|||||||
"num_threads",
|
"num_threads",
|
||||||
],
|
],
|
||||||
fieldGroups: {
|
fieldGroups: {
|
||||||
detection: ["listen", "filters"],
|
detection: ["enabled", "listen", "filters"],
|
||||||
sensitivity: ["min_volume", "max_not_heard"],
|
sensitivity: ["min_volume", "max_not_heard"],
|
||||||
},
|
},
|
||||||
hiddenFields: ["enabled_in_config"],
|
hiddenFields: ["enabled_in_config"],
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const DetectSection = createConfigSection({
|
|||||||
"stationary",
|
"stationary",
|
||||||
],
|
],
|
||||||
fieldGroups: {
|
fieldGroups: {
|
||||||
resolution: ["width", "height"],
|
resolution: ["enabled", "width", "height"],
|
||||||
tracking: ["min_initialized", "max_disappeared"],
|
tracking: ["min_initialized", "max_disappeared"],
|
||||||
},
|
},
|
||||||
hiddenFields: ["enabled_in_config"],
|
hiddenFields: ["enabled_in_config"],
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export const MotionSection = createConfigSection({
|
|||||||
"mqtt_off_delay",
|
"mqtt_off_delay",
|
||||||
],
|
],
|
||||||
fieldGroups: {
|
fieldGroups: {
|
||||||
sensitivity: ["threshold", "contour_area"],
|
sensitivity: ["enabled", "threshold", "contour_area"],
|
||||||
algorithm: ["improve_contrast", "delta_alpha", "frame_alpha"],
|
algorithm: ["improve_contrast", "delta_alpha", "frame_alpha"],
|
||||||
},
|
},
|
||||||
hiddenFields: ["enabled_in_config", "mask", "raw_mask"],
|
hiddenFields: ["enabled_in_config", "mask", "raw_mask"],
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const RecordSection = createConfigSection({
|
|||||||
"export",
|
"export",
|
||||||
],
|
],
|
||||||
fieldGroups: {
|
fieldGroups: {
|
||||||
retention: ["continuous", "motion"],
|
retention: ["enabled", "continuous", "motion"],
|
||||||
events: ["alerts", "detections"],
|
events: ["alerts", "detections"],
|
||||||
},
|
},
|
||||||
hiddenFields: ["enabled_in_config", "sync_recordings"],
|
hiddenFields: ["enabled_in_config", "sync_recordings"],
|
||||||
|
|||||||
@ -7,7 +7,7 @@ export const ReviewSection = createConfigSection({
|
|||||||
sectionPath: "review",
|
sectionPath: "review",
|
||||||
i18nNamespace: "config/review",
|
i18nNamespace: "config/review",
|
||||||
defaultConfig: {
|
defaultConfig: {
|
||||||
fieldOrder: ["alerts", "detections"],
|
fieldOrder: ["alerts", "detections", "genai"],
|
||||||
fieldGroups: {},
|
fieldGroups: {},
|
||||||
hiddenFields: [
|
hiddenFields: [
|
||||||
"enabled_in_config",
|
"enabled_in_config",
|
||||||
@ -20,6 +20,16 @@ export const ReviewSection = createConfigSection({
|
|||||||
"genai.enabled_in_config",
|
"genai.enabled_in_config",
|
||||||
],
|
],
|
||||||
advancedFields: [],
|
advancedFields: [],
|
||||||
|
uiSchema: {
|
||||||
|
genai: {
|
||||||
|
additional_concerns: {
|
||||||
|
"ui:widget": "textarea",
|
||||||
|
},
|
||||||
|
activity_context_prompt: {
|
||||||
|
"ui:widget": "textarea",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const SnapshotsSection = createConfigSection({
|
|||||||
"retain",
|
"retain",
|
||||||
],
|
],
|
||||||
fieldGroups: {
|
fieldGroups: {
|
||||||
display: ["bounding_box", "crop", "quality", "timestamp"],
|
display: ["enabled", "bounding_box", "crop", "quality", "timestamp"],
|
||||||
},
|
},
|
||||||
hiddenFields: ["enabled_in_config"],
|
hiddenFields: ["enabled_in_config"],
|
||||||
advancedFields: ["quality", "retain"],
|
advancedFields: ["quality", "retain"],
|
||||||
|
|||||||
@ -8,10 +8,7 @@ export const TimestampSection = createConfigSection({
|
|||||||
i18nNamespace: "config/timestamp_style",
|
i18nNamespace: "config/timestamp_style",
|
||||||
defaultConfig: {
|
defaultConfig: {
|
||||||
fieldOrder: ["position", "format", "color", "thickness"],
|
fieldOrder: ["position", "format", "color", "thickness"],
|
||||||
fieldGroups: {
|
hiddenFields: ["effect", "enabled_in_config"],
|
||||||
appearance: ["color", "thickness"],
|
|
||||||
},
|
|
||||||
hiddenFields: ["enabled_in_config"],
|
|
||||||
advancedFields: [],
|
advancedFields: [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -46,7 +46,9 @@ export function FieldTemplate(props: FieldTemplateProps) {
|
|||||||
|
|
||||||
// Determine field characteristics
|
// Determine field characteristics
|
||||||
const isAdvanced = uiOptions.advanced === true;
|
const isAdvanced = uiOptions.advanced === true;
|
||||||
const isBoolean = schema.type === "boolean";
|
const isBoolean =
|
||||||
|
schema.type === "boolean" ||
|
||||||
|
(Array.isArray(schema.type) && schema.type.includes("boolean"));
|
||||||
const isObjectField = schema.type === "object";
|
const isObjectField = schema.type === "object";
|
||||||
const isNullableUnion = isNullableUnionSchema(schema as StrictRJSFSchema);
|
const isNullableUnion = isNullableUnionSchema(schema as StrictRJSFSchema);
|
||||||
const suppressMultiSchema =
|
const suppressMultiSchema =
|
||||||
@ -135,7 +137,7 @@ export function FieldTemplate(props: FieldTemplateProps) {
|
|||||||
</Label>
|
</Label>
|
||||||
)}
|
)}
|
||||||
{finalDescription && !isMultiSchemaWrapper && (
|
{finalDescription && !isMultiSchemaWrapper && (
|
||||||
<p className="max-w-md text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
{finalDescription}
|
{finalDescription}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -175,7 +175,7 @@ const globalSectionConfigs: Record<
|
|||||||
telemetry: {
|
telemetry: {
|
||||||
i18nNamespace: "config/telemetry",
|
i18nNamespace: "config/telemetry",
|
||||||
fieldOrder: ["network_interfaces", "stats", "version_check"],
|
fieldOrder: ["network_interfaces", "stats", "version_check"],
|
||||||
advancedFields: ["stats"],
|
advancedFields: [],
|
||||||
},
|
},
|
||||||
birdseye: {
|
birdseye: {
|
||||||
i18nNamespace: "config/birdseye",
|
i18nNamespace: "config/birdseye",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user