Semantic Search Frontend (#12112)

* Add basic search page

* Abstract filters to separate components

* Make searching functional

* Add loading and no results indicators

* Implement searching

* Combine account and settings menus on mobile

* Support using thumbnail for in progress detections

* Fetch previews

* Move recordings view and open recordings when search is selected

* Implement detail pane

* Implement saving of description

* Implement similarity search

* Fix clicking

* Add date range picker

* Fix

* Fix iOS zoom bug

* Mobile fixes

* Use text area

* Fix spacing for drawer

* Fix fetching previews incorrectly
This commit is contained in:
Nicolas Mowen
2024-08-29 20:19:50 -06:00
parent 0d7a148897
commit 9d7e499adb
24 changed files with 2682 additions and 755 deletions
+15
View File
@@ -12,6 +12,21 @@ export function useFormattedTimestamp(timestamp: number, format: string) {
return formattedTimestamp;
}
export function useFormattedRange(start: number, end: number, format: string) {
const formattedStart = useMemo(() => {
return formatUnixTimestampToDateTime(start, {
strftime_fmt: format,
});
}, [format, start]);
const formattedEnd = useMemo(() => {
return formatUnixTimestampToDateTime(end, {
strftime_fmt: format,
});
}, [format, end]);
return `${formattedStart} - ${formattedEnd}`;
}
export function useTimezone(config: FrigateConfig | undefined) {
return useMemo(() => {
if (!config) {