mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 17:17:40 +03:00
remove alert action for now and add descriptions
This commit is contained in:
parent
59358e2598
commit
5e9f83696d
@ -705,6 +705,8 @@
|
|||||||
"title": "Content",
|
"title": "Content",
|
||||||
"imagePlaceholder": "Select an image",
|
"imagePlaceholder": "Select an image",
|
||||||
"textPlaceholder": "Enter text content",
|
"textPlaceholder": "Enter text content",
|
||||||
|
"imageDesc": "Select an image to trigger this action when a similar image is detected.",
|
||||||
|
"textDesc": "Enter text to trigger this action when a similar tracked object description is detected.",
|
||||||
"error": {
|
"error": {
|
||||||
"required": "Content is required."
|
"required": "Content is required."
|
||||||
}
|
}
|
||||||
@ -718,6 +720,7 @@
|
|||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"title": "Actions",
|
"title": "Actions",
|
||||||
|
"desc": "By default, Frigate fires an MQTT message for all triggers. Choose an additional action to perform when this trigger fires.",
|
||||||
"error": {
|
"error": {
|
||||||
"min": "At least one action must be selected."
|
"min": "At least one action must be selected."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
@ -35,6 +36,7 @@ import { FrigateConfig } from "@/types/frigateConfig";
|
|||||||
import ImagePicker from "@/components/overlay/ImagePicker";
|
import ImagePicker from "@/components/overlay/ImagePicker";
|
||||||
import { Trigger, TriggerAction, TriggerType } from "@/types/trigger";
|
import { Trigger, TriggerAction, TriggerType } from "@/types/trigger";
|
||||||
import { Switch } from "@/components/ui/switch";
|
import { Switch } from "@/components/ui/switch";
|
||||||
|
import { Textarea } from "../ui/textarea";
|
||||||
|
|
||||||
type CreateTriggerDialogProps = {
|
type CreateTriggerDialogProps = {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
@ -268,24 +270,34 @@ export default function CreateTriggerDialog({
|
|||||||
{t("triggers.dialog.form.content.title")}
|
{t("triggers.dialog.form.content.title")}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
{form.watch("type") === "thumbnail" ? (
|
{form.watch("type") === "thumbnail" ? (
|
||||||
<FormControl>
|
<>
|
||||||
<ImagePicker
|
<FormControl>
|
||||||
selectedImageId={field.value}
|
<ImagePicker
|
||||||
setSelectedImageId={field.onChange}
|
selectedImageId={field.value}
|
||||||
camera={selectedCamera}
|
setSelectedImageId={field.onChange}
|
||||||
/>
|
camera={selectedCamera}
|
||||||
</FormControl>
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
{t("triggers.dialog.form.content.imageDesc")}
|
||||||
|
</FormDescription>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<FormControl>
|
<>
|
||||||
<Input
|
<FormControl>
|
||||||
placeholder={t(
|
<Textarea
|
||||||
"triggers.dialog.form.content.textPlaceholder",
|
placeholder={t(
|
||||||
)}
|
"triggers.dialog.form.content.textPlaceholder",
|
||||||
className="h-10"
|
)}
|
||||||
{...field}
|
{...field}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
{t("triggers.dialog.form.content.textDesc")}
|
||||||
|
</FormDescription>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
@ -328,7 +340,7 @@ export default function CreateTriggerDialog({
|
|||||||
{t("triggers.dialog.form.actions.title")}
|
{t("triggers.dialog.form.actions.title")}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{["alert", "notification"].map((action) => (
|
{["notification"].map((action) => (
|
||||||
<div key={action} className="flex items-center space-x-2">
|
<div key={action} className="flex items-center space-x-2">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -357,6 +369,9 @@ export default function CreateTriggerDialog({
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
<FormDescription>
|
||||||
|
{t("triggers.dialog.form.actions.desc")}
|
||||||
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user