Agregar proxy para clips y snapshots de Frigate
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m1s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m1s
- Crear /api/frigate/events/:eventId/clip con soporte de range requests - Crear /api/frigate/events/:eventId/snapshot - Usar IP interna 192.168.87.29:5000 para evitar autenticacion Authentik - Actualizar URLs en useFrigateEvents para usar proxies internos
This commit is contained in:
@@ -37,7 +37,7 @@ export interface FrigateEvent {
|
||||
}
|
||||
|
||||
export const useFrigateEvents = () => {
|
||||
const FRIGATE_PUBLIC_URL = 'https://camaras.nucleoriofrio.com'
|
||||
// Ya no usamos URL publica, todo va por proxy interno
|
||||
|
||||
const isCreating = useState<boolean>('frigate_creating', () => false)
|
||||
const isLoadingEvents = useState<boolean>('frigate_loading_events', () => false)
|
||||
@@ -74,17 +74,17 @@ export const useFrigateEvents = () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* Genera la URL del clip de un evento
|
||||
* Genera la URL del clip de un evento (via proxy interno)
|
||||
*/
|
||||
const getEventClipUrl = (eventId: string): string => {
|
||||
return `${FRIGATE_PUBLIC_URL}/api/events/${eventId}/clip.mp4`
|
||||
return `/api/frigate/events/${eventId}/clip`
|
||||
}
|
||||
|
||||
/**
|
||||
* Genera la URL del snapshot de un evento
|
||||
* Genera la URL del snapshot de un evento (via proxy interno)
|
||||
*/
|
||||
const getEventSnapshotUrl = (eventId: string): string => {
|
||||
return `${FRIGATE_PUBLIC_URL}/api/events/${eventId}/snapshot.jpg`
|
||||
return `/api/frigate/events/${eventId}/snapshot`
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user