mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-06 19:25:22 +03:00
Move event ID to searchParams, add View All button
This commit is contained in:
parent
42fd2f282d
commit
e52eced7a0
@ -51,11 +51,12 @@ export default function Events({ path, ...props }) {
|
|||||||
const [searchParams, setSearchParams] = useState({
|
const [searchParams, setSearchParams] = useState({
|
||||||
before: null,
|
before: null,
|
||||||
after: null,
|
after: null,
|
||||||
cameras: props.event ? '' : props.cameras ?? 'all',
|
cameras: 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',
|
||||||
favorites: props.favorites ?? 0,
|
favorites: props.favorites ?? 0,
|
||||||
|
event: props.event,
|
||||||
});
|
});
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
showDownloadMenu: false,
|
showDownloadMenu: false,
|
||||||
@ -87,8 +88,8 @@ export default function Events({ path, ...props }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const eventsFetcher = useCallback((path, params) => {
|
const eventsFetcher = useCallback((path, params) => {
|
||||||
if (props.event) {
|
if (params.event) {
|
||||||
path = `${path}/${props.event}`;
|
path = `${path}/${params.event}`;
|
||||||
return axios.get(path).then((res) => [res.data]);
|
return axios.get(path).then((res) => [res.data]);
|
||||||
}
|
}
|
||||||
params = { ...params, include_thumbnails: 0, limit: API_LIMIT };
|
params = { ...params, include_thumbnails: 0, limit: API_LIMIT };
|
||||||
@ -359,6 +360,11 @@ export default function Events({ path, ...props }) {
|
|||||||
onSelectSingle={(item) => onFilter('sub_labels', item)}
|
onSelectSingle={(item) => onFilter('sub_labels', item)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{searchParams.event && (
|
||||||
|
<Button className="ml-2" onClick={() => onFilter('event',null)} type="text">
|
||||||
|
View All
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
|
||||||
<StarRecording
|
<StarRecording
|
||||||
className="h-10 w-10 text-yellow-300 cursor-pointer ml-auto"
|
className="h-10 w-10 text-yellow-300 cursor-pointer ml-auto"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user