misc triggers tweaks

i18n fixes
fix toaster color
fix clicking on labels selecting incorrect checkbox
This commit is contained in:
Josh Hawkins 2026-01-15 20:41:39 -06:00
parent bf099c3edd
commit 32f6114573
4 changed files with 23 additions and 13 deletions

View File

@ -3,6 +3,7 @@
"untilForTime": "Until {{time}}",
"untilForRestart": "Until Frigate restarts.",
"untilRestart": "Until restart",
"never": "Never",
"ago": "{{timeAgo}} ago",
"justNow": "Just now",
"today": "Today",

View File

@ -268,7 +268,7 @@ export default function CreateTriggerDialog({
<FormItem className="flex flex-row items-center justify-between">
<div className="space-y-0.5">
<FormLabel className="text-base">
{t("enabled", { ns: "common" })}
{t("button.enabled", { ns: "common" })}
</FormLabel>
<div className="text-sm text-muted-foreground">
{t("triggers.dialog.form.enabled.description")}
@ -394,7 +394,10 @@ export default function CreateTriggerDialog({
</FormLabel>
<div className="space-y-2">
{availableActions.map((action) => (
<div key={action} className="flex items-center space-x-2">
<label
key={action}
className="flex cursor-pointer items-center space-x-2"
>
<FormControl>
<Checkbox
checked={form
@ -416,10 +419,10 @@ export default function CreateTriggerDialog({
}}
/>
</FormControl>
<FormLabel className="text-sm font-normal">
<span className="text-sm font-normal">
{t(`triggers.actions.${action}`)}
</FormLabel>
</div>
</span>
</label>
))}
</div>
<FormDescription>

View File

@ -142,7 +142,10 @@ export default function Step3ThresholdAndActions({
<FormLabel>{t("triggers.dialog.form.actions.title")}</FormLabel>
<div className="space-y-2">
{availableActions.map((action) => (
<div key={action} className="flex items-center space-x-2">
<label
key={action}
className="flex cursor-pointer items-center space-x-2"
>
<FormControl>
<Checkbox
checked={form
@ -164,10 +167,10 @@ export default function Step3ThresholdAndActions({
}}
/>
</FormControl>
<FormLabel className="text-sm font-normal">
<span className="text-sm font-normal">
{t(`triggers.actions.${action}`)}
</FormLabel>
</div>
</span>
</label>
))}
</div>
<FormDescription>

View File

@ -1,6 +1,7 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { Toaster, toast } from "sonner";
import { toast } from "sonner";
import { Toaster } from "@/components/ui/sonner";
import useSWR from "swr";
import axios from "axios";
import { Button } from "@/components/ui/button";
@ -598,7 +599,7 @@ export default function TriggerView({
date_style: "medium",
},
)
: "Never"}
: t("never", { ns: "common" })}
</span>
{trigger_status?.triggers[trigger.name]
?.triggering_event_id && (
@ -663,7 +664,9 @@ export default function TriggerView({
<TableHeader className="sticky top-0 bg-muted/50">
<TableRow>
<TableHead className="w-4"></TableHead>
<TableHead>{t("name", { ns: "common" })}</TableHead>
<TableHead>
{t("name", { ns: "triggers.table.name" })}
</TableHead>
<TableHead>{t("triggers.table.type")}</TableHead>
<TableHead>
{t("triggers.table.lastTriggered")}
@ -759,7 +762,7 @@ export default function TriggerView({
date_style: "medium",
},
)
: "Never"}
: t("time.never", { ns: "common" })}
</span>
{trigger_status?.triggers[trigger.name]
?.triggering_event_id && (