mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-06 19:25:22 +03:00
Add capability to link directly to an event ID in the web UI
This commit is contained in:
parent
9185753322
commit
42fd2f282d
@ -51,7 +51,7 @@ export default function Events({ path, ...props }) {
|
|||||||
const [searchParams, setSearchParams] = useState({
|
const [searchParams, setSearchParams] = useState({
|
||||||
before: null,
|
before: null,
|
||||||
after: null,
|
after: null,
|
||||||
cameras: props.cameras ?? 'all',
|
cameras: props.event ? '' : props.cameras ?? 'all',
|
||||||
labels: props.labels ?? 'all',
|
labels: props.labels ?? 'all',
|
||||||
zones: props.zones ?? 'all',
|
zones: props.zones ?? 'all',
|
||||||
sub_labels: props.sub_labels ?? 'all',
|
sub_labels: props.sub_labels ?? 'all',
|
||||||
@ -69,7 +69,7 @@ export default function Events({ path, ...props }) {
|
|||||||
validBox: null,
|
validBox: null,
|
||||||
});
|
});
|
||||||
const [uploading, setUploading] = useState([]);
|
const [uploading, setUploading] = useState([]);
|
||||||
const [viewEvent, setViewEvent] = useState();
|
const [viewEvent, setViewEvent] = useState(props.event);
|
||||||
const [eventOverlay, setEventOverlay] = useState();
|
const [eventOverlay, setEventOverlay] = useState();
|
||||||
const [eventDetailType, setEventDetailType] = useState('clip');
|
const [eventDetailType, setEventDetailType] = useState('clip');
|
||||||
const [downloadEvent, setDownloadEvent] = useState({
|
const [downloadEvent, setDownloadEvent] = useState({
|
||||||
@ -87,6 +87,10 @@ export default function Events({ path, ...props }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const eventsFetcher = useCallback((path, params) => {
|
const eventsFetcher = useCallback((path, params) => {
|
||||||
|
if (props.event) {
|
||||||
|
path = `${path}/${props.event}`;
|
||||||
|
return axios.get(path).then((res) => [res.data]);
|
||||||
|
}
|
||||||
params = { ...params, include_thumbnails: 0, limit: API_LIMIT };
|
params = { ...params, include_thumbnails: 0, limit: API_LIMIT };
|
||||||
return axios.get(path, { params }).then((res) => res.data);
|
return axios.get(path, { params }).then((res) => res.data);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user