mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 23:15:28 +03:00
Compare commits
No commits in common. "02de01261e569725d494972f5233a110e2d6273e" and "e10d816798ea905dfec55dc195a9fabb00431402" have entirely different histories.
02de01261e
...
e10d816798
@ -101,7 +101,7 @@
|
||||
"recording": {
|
||||
"shareTimestamp": {
|
||||
"label": "Share Timestamp",
|
||||
"title": "Share Timestamp",
|
||||
"title": "Share Review Timestamp",
|
||||
"description": "Share a timestamped URL of current player position or choose a custom timestamp. Note that this is not a public share URL and is only accessible to users with access to Frigate and this camera.",
|
||||
"current": "Current Player Timestamp",
|
||||
"custom": "Custom Timestamp",
|
||||
|
||||
@ -518,6 +518,12 @@ export default function MobileReviewSettingsDrawer({
|
||||
content = (
|
||||
<div className="w-full">
|
||||
<div className="relative h-8 w-full">
|
||||
<div
|
||||
className="absolute left-0 text-selected"
|
||||
onClick={() => setDrawerMode("select")}
|
||||
>
|
||||
{t("button.back", { ns: "common" })}
|
||||
</div>
|
||||
<div className="absolute left-1/2 -translate-x-1/2 text-muted-foreground">
|
||||
{t("recording.shareTimestamp.title", { ns: "components/dialog" })}
|
||||
</div>
|
||||
|
||||
@ -16,7 +16,7 @@ import {
|
||||
} from "@/components/ui/popover";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { useFormattedTimestamp, useTimeFormat } from "@/hooks/use-date-utils";
|
||||
import { useFormattedTimestamp } from "@/hooks/use-date-utils";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { getUTCOffset } from "@/utils/dateUtil";
|
||||
@ -84,7 +84,7 @@ export default function ShareTimestampDialog({
|
||||
<Dialog open={open} onOpenChange={handleOpenChange}>
|
||||
<DialogContent className="sm:rounded-lg md:rounded-2xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="whitespace-nowrap">
|
||||
<DialogTitle>
|
||||
{t("recording.shareTimestamp.title", { ns: "components/dialog" })}
|
||||
</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
@ -120,10 +120,9 @@ export function ShareTimestampContent({
|
||||
}: Readonly<ShareTimestampContentProps>) {
|
||||
const { t } = useTranslation(["common", "components/dialog"]);
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const timeFormat = useTimeFormat(config);
|
||||
const currentTimestampLabel = useFormattedTimestamp(
|
||||
currentTime,
|
||||
timeFormat == "24hour"
|
||||
config?.ui.time_format == "24hour"
|
||||
? t("time.formattedTimestamp.24hour")
|
||||
: t("time.formattedTimestamp.12hour"),
|
||||
config?.ui.timezone,
|
||||
@ -200,7 +199,7 @@ export function ShareTimestampContent({
|
||||
className={cn("mt-4", !isDesktop && "flex flex-col-reverse gap-4")}
|
||||
>
|
||||
{onCancel && (
|
||||
<button
|
||||
<Button
|
||||
type="button"
|
||||
className={cn(
|
||||
"cursor-pointer p-2 text-center",
|
||||
@ -209,7 +208,7 @@ export function ShareTimestampContent({
|
||||
onClick={onCancel}
|
||||
>
|
||||
{t("button.cancel", { ns: "common" })}
|
||||
</button>
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
className={cn(!isDesktop && "w-full")}
|
||||
@ -237,7 +236,6 @@ function CustomTimestampSelector({
|
||||
}: Readonly<CustomTimestampSelectorProps>) {
|
||||
const { t } = useTranslation(["common"]);
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const timeFormat = useTimeFormat(config);
|
||||
|
||||
const timezoneOffset = useMemo(
|
||||
() =>
|
||||
@ -273,7 +271,7 @@ function CustomTimestampSelector({
|
||||
|
||||
const formattedTimestamp = useFormattedTimestamp(
|
||||
displayTimestamp,
|
||||
timeFormat == "24hour"
|
||||
config?.ui.time_format == "24hour"
|
||||
? t("time.formattedTimestamp.24hour")
|
||||
: t("time.formattedTimestamp.12hour"),
|
||||
);
|
||||
|
||||
@ -280,7 +280,6 @@ export default function Events() {
|
||||
// this pattern is also used LiveCameraView to enter recording view
|
||||
severity: "alert",
|
||||
timelineType: notificationTab,
|
||||
navigationSource: "shared-link",
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
@ -40,7 +40,6 @@ export type RecordingStartingPoint = {
|
||||
startTime: number;
|
||||
severity: ReviewSeverity;
|
||||
timelineType?: TimelineType;
|
||||
navigationSource?: "shared-link";
|
||||
};
|
||||
|
||||
export type RecordingPlayerError = "stalled" | "startup";
|
||||
|
||||
@ -349,16 +349,6 @@ export function RecordingView({
|
||||
[location.pathname, mainCamera, t],
|
||||
);
|
||||
|
||||
const handleBack = useCallback(() => {
|
||||
// if we came from a direct share link, there is no history to go back to, so navigate to the homepage instead
|
||||
if (recording?.navigationSource === "shared-link") {
|
||||
navigate("/");
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(-1);
|
||||
}, [navigate, recording?.navigationSource]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!scrubbing) {
|
||||
if (Math.abs(currentTime - playerTime) > 10) {
|
||||
@ -609,7 +599,7 @@ export function RecordingView({
|
||||
className="flex items-center gap-2.5 rounded-lg"
|
||||
aria-label={t("label.back", { ns: "common" })}
|
||||
size="sm"
|
||||
onClick={handleBack}
|
||||
onClick={() => navigate(-1)}
|
||||
>
|
||||
<IoMdArrowRoundBack className="size-5 text-secondary-foreground" />
|
||||
{isDesktop && (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user