mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
use base path when fetching go2rtc data
This commit is contained in:
parent
376e5b5c25
commit
70e5ce5771
@ -1,3 +1,4 @@
|
|||||||
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import { CameraConfig, FrigateConfig } from "@/types/frigateConfig";
|
import { CameraConfig, FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { useCallback, useEffect, useState, useMemo } from "react";
|
import { useCallback, useEffect, useState, useMemo } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -41,9 +42,12 @@ export default function useCameraLiveMode(
|
|||||||
|
|
||||||
const metadataPromises = streamNames.map(async (streamName) => {
|
const metadataPromises = streamNames.map(async (streamName) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/api/go2rtc/streams/${streamName}`, {
|
const response = await fetch(
|
||||||
priority: "low",
|
`${baseUrl}api/go2rtc/streams/${streamName}`,
|
||||||
});
|
{
|
||||||
|
priority: "low",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import { generateFixedHash, isValidId } from "./stringUtil";
|
import { generateFixedHash, isValidId } from "./stringUtil";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,9 +53,12 @@ export async function detectReolinkCamera(
|
|||||||
password,
|
password,
|
||||||
});
|
});
|
||||||
|
|
||||||
const response = await fetch(`/api/reolink/detect?${params.toString()}`, {
|
const response = await fetch(
|
||||||
method: "GET",
|
`${baseUrl}api/reolink/detect?${params.toString()}`,
|
||||||
});
|
{
|
||||||
|
method: "GET",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user