mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-26 16:34:43 +03:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user