Merge branch 'release-0.11.0' of https://github.com/blakeblackshear/frigate into sub_label_filter

This commit is contained in:
Nick Mowen 2022-05-20 09:46:39 -06:00
commit 1619e63235
6 changed files with 8 additions and 7 deletions

View File

@ -23,6 +23,7 @@ services:
- /dev/bus/usb:/dev/bus/usb - /dev/bus/usb:/dev/bus/usb
ports: ports:
- "1935:1935" - "1935:1935"
- "3000:3000"
- "5000:5000" - "5000:5000"
- "5001:5001" - "5001:5001"
- "8080:8080" - "8080:8080"

View File

@ -2,7 +2,7 @@ import { rest } from 'msw';
import { API_HOST } from '../src/env'; import { API_HOST } from '../src/env';
export const handlers = [ export const handlers = [
rest.get(`${API_HOST}/api/config`, (req, res, ctx) => { rest.get(`${API_HOST}api/config`, (req, res, ctx) => {
return res( return res(
ctx.status(200), ctx.status(200),
ctx.json({ ctx.json({
@ -35,7 +35,7 @@ export const handlers = [
}) })
); );
}), }),
rest.get(`${API_HOST}/api/stats`, (req, res, ctx) => { rest.get(`${API_HOST}api/stats`, (req, res, ctx) => {
return res( return res(
ctx.status(200), ctx.status(200),
ctx.json({ ctx.json({
@ -54,7 +54,7 @@ export const handlers = [
}) })
); );
}), }),
rest.get(`${API_HOST}/api/events`, (req, res, ctx) => { rest.get(`${API_HOST}api/events`, (req, res, ctx) => {
return res( return res(
ctx.status(200), ctx.status(200),
ctx.json( ctx.json(

View File

@ -3,7 +3,7 @@
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --host",
"lint": "eslint ./ --ext .jsx,.js,.tsx,.ts", "lint": "eslint ./ --ext .jsx,.js,.tsx,.ts",
"build": "tsc && vite build --base=/BASE_PATH/", "build": "tsc && vite build --base=/BASE_PATH/",
"preview": "vite preview", "preview": "vite preview",

View File

@ -1,2 +1,2 @@
export const ENV = 'test'; export const ENV = 'test';
export const API_HOST = 'http://base-url.local:5000'; export const API_HOST = 'http://base-url.local:5000/';

View File

@ -18,6 +18,6 @@ describe('useApiHost', () => {
<Test /> <Test />
</ApiProvider> </ApiProvider>
); );
expect(screen.queryByText('http://base-url.local:5000')).toBeInTheDocument(); expect(screen.queryByText('http://base-url.local:5000/')).toBeInTheDocument();
}); });
}); });

View File

@ -1,2 +1,2 @@
export const ENV = import.meta.env.MODE; export const ENV = import.meta.env.MODE;
export const API_HOST = ENV === "production" ? "" : "http://localhost:5000"; export const API_HOST = ENV === 'production' ? '' : 'http://localhost:5000/';