Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev-rk
Browse files Browse the repository at this point in the history
  • Loading branch information
a2nt committed Aug 29, 2024
2 parents be48851 + f4f3cfa commit 56af28c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/docs/configuration/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ snapshots:
quality: 70

# Optional: Restream configuration
# Uses https://github.com/AlexxIT/go2rtc (v1.8.3)
# Uses https://github.com/AlexxIT/go2rtc (v1.9.2)
go2rtc:

# Optional: jsmpeg stream configuration for WebUI
Expand Down
54 changes: 39 additions & 15 deletions web/src/components/card/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { Drawer, DrawerContent } from "../ui/drawer";
import axios from "axios";
import { toast } from "sonner";
import useKeyboardListener from "@/hooks/use-keyboard-listener";
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
import { capitalizeFirstLetter } from "@/utils/stringUtil";

type ReviewCardProps = {
event: ReviewSegment;
Expand Down Expand Up @@ -153,21 +155,43 @@ export default function ReviewCard({
}}
/>
<div className="flex items-center justify-between">
<div className="flex items-center justify-evenly gap-1">
{event.data.objects.map((object) => {
return getIconForLabel(
object,
"size-3 text-primary dark:text-white",
);
})}
{event.data.audio.map((audio) => {
return getIconForLabel(
audio,
"size-3 text-primary dark:text-white",
);
})}
<div className="font-extra-light text-xs">{formattedDate}</div>
</div>
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center justify-evenly gap-1">
<>
{event.data.objects.map((object) => {
return getIconForLabel(
object,
"size-3 text-primary dark:text-white",
);
})}
{event.data.audio.map((audio) => {
return getIconForLabel(
audio,
"size-3 text-primary dark:text-white",
);
})}
</>
<div className="font-extra-light text-xs">{formattedDate}</div>
</div>
</TooltipTrigger>
<TooltipContent className="capitalize">
{[
...new Set([
...(event.data.objects || []),
...(event.data.sub_labels || []),
...(event.data.audio || []),
]),
]
.filter(
(item) => item !== undefined && !item.includes("-verified"),
)
.map((text) => capitalizeFirstLetter(text))
.sort()
.join(", ")
.replaceAll("-verified", "")}
</TooltipContent>
</Tooltip>
<TimeAgo
className="text-xs text-muted-foreground"
time={event.start_time * 1000}
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/filter/CameraGroupSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,14 @@ export function CameraGroupEdit({
message: "Camera group name already exists.",
},
)
.refine(
(value: string) => {
return !value.includes(".");
},
{
message: "Camera group name must not contain a period.",
},
)
.refine((value: string) => value.toLowerCase() !== "default", {
message: "Invalid camera group name.",
}),
Expand Down
31 changes: 17 additions & 14 deletions web/src/components/player/LivePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Chip from "../indicators/Chip";
import { capitalizeFirstLetter } from "@/utils/stringUtil";
import { cn } from "@/lib/utils";
import { TbExclamationCircle } from "react-icons/tb";
import { TooltipPortal } from "@radix-ui/react-tooltip";

type LivePlayerProps = {
cameraRef?: (ref: HTMLDivElement | null) => void;
Expand Down Expand Up @@ -258,20 +259,22 @@ export default function LivePlayer({
</div>
</TooltipTrigger>
</div>
<TooltipContent className="capitalize">
{[
...new Set([
...(objects || []).map(({ label, sub_label }) =>
label.endsWith("verified") ? sub_label : label,
),
]),
]
.filter((label) => label?.includes("-verified") == false)
.map((label) => capitalizeFirstLetter(label))
.sort()
.join(", ")
.replaceAll("-verified", "")}
</TooltipContent>
<TooltipPortal>
<TooltipContent className="capitalize">
{[
...new Set([
...(objects || []).map(({ label, sub_label }) =>
label.endsWith("verified") ? sub_label : label,
),
]),
]
.filter((label) => label?.includes("-verified") == false)
.map((label) => capitalizeFirstLetter(label))
.sort()
.join(", ")
.replaceAll("-verified", "")}
</TooltipContent>
</TooltipPortal>
</Tooltip>
</div>
)}
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/settings/ZoneEditPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ export default function ZoneEditPane({
{
message: "Zone name already exists on this camera.",
},
)
.refine(
(value: string) => {
return !value.includes(".");
},
{
message: "Zone name must not contain a period.",
},
),
inertia: z.coerce
.number()
Expand Down

0 comments on commit 56af28c

Please sign in to comment.