mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
fixed switched start/end time, changed length to duration
This commit is contained in:
parent
df64146d05
commit
e46a10595c
@ -22,11 +22,7 @@ import CalendarIcon from '../icons/Calendar';
|
|||||||
import Calendar from '../components/Calendar';
|
import Calendar from '../components/Calendar';
|
||||||
import Button from '../components/Button';
|
import Button from '../components/Button';
|
||||||
import Dialog from '../components/Dialog';
|
import Dialog from '../components/Dialog';
|
||||||
import {
|
import { fromUnixTime, intervalToDuration, formatDuration } from 'date-fns';
|
||||||
fromUnixTime,
|
|
||||||
intervalToDuration,
|
|
||||||
formatDuration,
|
|
||||||
} from 'date-fns';
|
|
||||||
|
|
||||||
const API_LIMIT = 25;
|
const API_LIMIT = 25;
|
||||||
|
|
||||||
@ -42,7 +38,7 @@ const monthsAgo = (num) => {
|
|||||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() / 1000;
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() / 1000;
|
||||||
};
|
};
|
||||||
|
|
||||||
const clipLength = (start_time, end_time) => {
|
const clipDuration = (start_time, end_time) => {
|
||||||
const start = fromUnixTime(start_time);
|
const start = fromUnixTime(start_time);
|
||||||
const end = fromUnixTime(end_time);
|
const end = fromUnixTime(end_time);
|
||||||
let duration = 'In Progress';
|
let duration = 'In Progress';
|
||||||
@ -474,7 +470,7 @@ export default function Events({ path, ...props }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="text-sm">
|
<div className="text-sm">
|
||||||
{new Date(event.start_time * 1000).toLocaleDateString()}{' '}
|
{new Date(event.start_time * 1000).toLocaleDateString()}{' '}
|
||||||
{new Date(event.start_time * 1000).toLocaleTimeString()} ({clipLength(event.end_time, event.start_time)})
|
{new Date(event.start_time * 1000).toLocaleTimeString()} ({clipDuration(event.start_time, event.end_time)})
|
||||||
</div>
|
</div>
|
||||||
<div className="capitalize text-sm flex align-center mt-1">
|
<div className="capitalize text-sm flex align-center mt-1">
|
||||||
<Camera className="h-5 w-5 mr-2 inline" />
|
<Camera className="h-5 w-5 mr-2 inline" />
|
||||||
@ -537,9 +533,9 @@ export default function Events({ path, ...props }) {
|
|||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
seekOptions={{ forward: 10, back: 5 }}
|
seekOptions={{ forward: 10, back: 5 }}
|
||||||
onReady={() => {}}
|
onReady={() => { }}
|
||||||
/>
|
/>
|
||||||
) : null }
|
) : null}
|
||||||
|
|
||||||
{((eventDetailType == 'image') || !event.has_clip) ? (
|
{((eventDetailType == 'image') || !event.has_clip) ? (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
@ -553,7 +549,7 @@ export default function Events({ path, ...props }) {
|
|||||||
alt={`${event.label} at ${(event.top_score * 100).toFixed(0)}% confidence`}
|
alt={`${event.label} at ${(event.top_score * 100).toFixed(0)}% confidence`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : null }
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user