fix lint warnings
This commit is contained in:
parent
449c3c2058
commit
d59e6c50e0
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
# Build commands:
|
||||||
|
# - rm dist -r -Force ; yarn build
|
||||||
|
# - $VERSION=0.1
|
||||||
|
# - docker build --pull --rm -t oncharterliz/frigate-proxy:latest -t oncharterliz/frigate-proxy:$VERSION "."
|
||||||
|
# - docker image push --all-tags oncharterliz/frigate-proxy
|
||||||
|
|
||||||
|
FROM node:18-alpine AS frigate-proxy
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json yarn.lock ./
|
||||||
|
|
||||||
|
RUN yarn install --production
|
||||||
|
|
||||||
|
COPY ./dist ./dist
|
||||||
|
|
||||||
|
CMD yarn prod
|
||||||
|
EXPOSE 4000
|
||||||
@ -78,7 +78,6 @@
|
|||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@types/strftime": "^0.9.8",
|
"@types/strftime": "^0.9.8",
|
||||||
"@types/uuid": "^9.0.2",
|
"@types/uuid": "^9.0.2",
|
||||||
"@types/video.js": "^7.3.56",
|
"@types/video.js": "^7.3.56"
|
||||||
"uuid": "^9.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import { Flex, Grid, Group, TextInput } from '@mantine/core';
|
import { Flex, Grid, TextInput } from '@mantine/core';
|
||||||
import { useContext, useState, useEffect, useMemo } from 'react';
|
|
||||||
import { Context } from '..';
|
|
||||||
import { observer } from 'mobx-react-lite'
|
|
||||||
import CenterLoader from '../shared/components/loaders/CenterLoader';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { frigateApi, frigateQueryKeys } from '../services/frigate.proxy/frigate.api';
|
|
||||||
import RetryErrorPage from './RetryErrorPage';
|
|
||||||
import CameraCard from '../widgets/CameraCard';
|
|
||||||
import { IconSearch } from '@tabler/icons-react';
|
import { IconSearch } from '@tabler/icons-react';
|
||||||
import React from 'react';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
import { Context } from '..';
|
||||||
|
import { frigateApi, frigateQueryKeys } from '../services/frigate.proxy/frigate.api';
|
||||||
import { GetCameraWHostWConfig } from '../services/frigate.proxy/frigate.schema';
|
import { GetCameraWHostWConfig } from '../services/frigate.proxy/frigate.schema';
|
||||||
|
import CenterLoader from '../shared/components/loaders/CenterLoader';
|
||||||
|
import CameraCard from '../widgets/CameraCard';
|
||||||
|
import RetryErrorPage from './RetryErrorPage';
|
||||||
|
|
||||||
const MainPage = () => {
|
const MainPage = () => {
|
||||||
|
const executed = useRef(false)
|
||||||
const { sideBarsStore } = useContext(Context)
|
const { sideBarsStore } = useContext(Context)
|
||||||
const [searchQuery, setSearchQuery] = useState<string>()
|
const [searchQuery, setSearchQuery] = useState<string>()
|
||||||
const [filteredCameras, setFilteredCameras] = useState<GetCameraWHostWConfig[]>()
|
const [filteredCameras, setFilteredCameras] = useState<GetCameraWHostWConfig[]>()
|
||||||
@ -30,28 +30,37 @@ const MainPage = () => {
|
|||||||
}, [searchQuery, cameras])
|
}, [searchQuery, cameras])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sideBarsStore.rightVisible = false
|
if (!executed.current) {
|
||||||
sideBarsStore.setLeftChildren(null)
|
sideBarsStore.rightVisible = false
|
||||||
sideBarsStore.setRightChildren(null)
|
sideBarsStore.setLeftChildren(null)
|
||||||
}, [])
|
sideBarsStore.setRightChildren(null)
|
||||||
|
executed.current = true
|
||||||
|
}
|
||||||
|
}, [sideBarsStore])
|
||||||
|
|
||||||
const cards = useMemo(() => {
|
const cards = useMemo(() => {
|
||||||
if (filteredCameras)
|
if (filteredCameras)
|
||||||
return filteredCameras.map(camera => (
|
return filteredCameras.filter(camera => {
|
||||||
|
if (camera.frigateHost && !camera.frigateHost.enabled) return false
|
||||||
|
return true
|
||||||
|
}).map(camera => (
|
||||||
<CameraCard
|
<CameraCard
|
||||||
key={camera.id}
|
key={camera.id}
|
||||||
camera={camera}
|
camera={camera}
|
||||||
/>)
|
/>)
|
||||||
)
|
)
|
||||||
else
|
else if (cameras)
|
||||||
return cameras?.map(
|
return cameras.filter(camera => {
|
||||||
camera => (
|
if (camera.frigateHost && !camera.frigateHost.enabled) return false
|
||||||
<CameraCard
|
return true
|
||||||
key={camera.id}
|
}).map(camera => (
|
||||||
camera={camera}
|
<CameraCard
|
||||||
/>)
|
key={camera.id}
|
||||||
|
camera={camera}
|
||||||
|
/>)
|
||||||
)
|
)
|
||||||
}, [cameras, filteredCameras, searchQuery])
|
else return []
|
||||||
|
}, [cameras, filteredCameras])
|
||||||
|
|
||||||
if (isPending) return <CenterLoader />
|
if (isPending) return <CenterLoader />
|
||||||
|
|
||||||
|
|||||||
@ -1,35 +1,31 @@
|
|||||||
import React, { Fragment, useContext, useEffect, useRef, useState } from 'react';
|
import { Flex, Grid, Group } from '@mantine/core';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { Button, Flex, Grid, Group, Indicator, Paper, Skeleton } from '@mantine/core';
|
import { useContext, useEffect, useRef } from 'react';
|
||||||
import RetryError from '../shared/components/RetryError';
|
|
||||||
import { DatePickerInput } from '@mantine/dates';
|
|
||||||
import HeadSearch from '../shared/components/inputs/HeadSearch';
|
|
||||||
import ViewSelector from '../shared/components/TableGridViewSelector';
|
|
||||||
import { useIntersection } from '@mantine/hooks';
|
|
||||||
import TestItem from './TestItem';
|
|
||||||
import { Context } from '..';
|
import { Context } from '..';
|
||||||
|
import HeadSearch from '../shared/components/inputs/HeadSearch';
|
||||||
|
import TestItem from './TestItem';
|
||||||
|
|
||||||
const Test = () => {
|
const Test = () => {
|
||||||
const [value, setValue] = useState<[Date | null, Date | null]>([null, null])
|
const executed = useRef(false)
|
||||||
|
|
||||||
const { sideBarsStore } = useContext(Context)
|
const { sideBarsStore } = useContext(Context)
|
||||||
sideBarsStore.rightVisible = true
|
sideBarsStore.rightVisible = true
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sideBarsStore.rightVisible = true
|
if (!executed.current) {
|
||||||
return () => {
|
sideBarsStore.rightVisible = false
|
||||||
sideBarsStore.rightVisible = false
|
sideBarsStore.setLeftChildren(null)
|
||||||
|
sideBarsStore.setRightChildren(null)
|
||||||
|
executed.current = true
|
||||||
}
|
}
|
||||||
}, [])
|
}, [sideBarsStore])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log('value', value)
|
|
||||||
}, [value])
|
|
||||||
|
|
||||||
const handleClick = () => {
|
// const handleClick = () => {
|
||||||
const startOfDay = new Date();
|
// const startOfDay = new Date();
|
||||||
startOfDay.setHours(0, 0, 0, 0);
|
// startOfDay.setHours(0, 0, 0, 0);
|
||||||
setValue([startOfDay, startOfDay])
|
// setValue([startOfDay, startOfDay])
|
||||||
}
|
// }
|
||||||
|
|
||||||
const cards = (qty: number) => {
|
const cards = (qty: number) => {
|
||||||
let items = []
|
let items = []
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
import { Burger, createStyles, Header, rem, Menu, Container, Group, Button, Flex } from "@mantine/core";
|
import { Button, Container, Flex, Group, Header, Menu, createStyles, rem } from "@mantine/core";
|
||||||
import { useDisclosure, useMediaQuery } from "@mantine/hooks";
|
|
||||||
import UserMenu from '../../shared/components/UserMenu';
|
|
||||||
import { useAuth } from 'react-oidc-context';
|
import { useAuth } from 'react-oidc-context';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { useAdminRole } from "../../hooks/useAdminRole";
|
||||||
|
import { routesPath } from "../../router/routes.path";
|
||||||
|
import UserMenu from '../../shared/components/UserMenu';
|
||||||
import ColorSchemeToggle from "../../shared/components/buttons/ColorSchemeToggle";
|
import ColorSchemeToggle from "../../shared/components/buttons/ColorSchemeToggle";
|
||||||
import Logo from "../../shared/components/images/LogoImage";
|
import Logo from "../../shared/components/images/LogoImage";
|
||||||
import { routesPath } from "../../router/routes.path";
|
|
||||||
import DrawerMenu from "../../shared/components/menu/DrawerMenu";
|
import DrawerMenu from "../../shared/components/menu/DrawerMenu";
|
||||||
import { useAdminRole } from "../../hooks/useAdminRole";
|
|
||||||
|
|
||||||
const HEADER_HEIGHT = rem(60)
|
const HEADER_HEIGHT = rem(60)
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { routesPath } from "../../router/routes.path";
|
import { routesPath } from "../../router/routes.path";
|
||||||
import { headerMenu } from "../../shared/strings/header.menu.strings";
|
import { headerMenu } from "../../shared/strings/header.menu.strings";
|
||||||
import { HeaderActionProps, LinkItem } from "./HeaderAction";
|
import { LinkItem } from "./HeaderAction";
|
||||||
|
|
||||||
export const headerLinks: LinkItem[] = [
|
export const headerLinks: LinkItem[] = [
|
||||||
{ link: routesPath.MAIN_PATH, label: headerMenu.home },
|
{ link: routesPath.MAIN_PATH, label: headerMenu.home },
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { Flex, Paper } from '@mantine/core';
|
import { Flex } from '@mantine/core';
|
||||||
import { IconPower } from '@tabler/icons-react';
|
import { IconPower } from '@tabler/icons-react';
|
||||||
import React from 'react';
|
|
||||||
import { frigateApi, frigateQueryKeys } from '../../services/frigate.proxy/frigate.api';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { frigateApi, frigateQueryKeys } from '../../services/frigate.proxy/frigate.api';
|
||||||
|
|
||||||
interface StateCellProps {
|
interface StateCellProps {
|
||||||
id?: string
|
id?: string
|
||||||
@ -12,7 +11,7 @@ const StateCell = ({
|
|||||||
id,
|
id,
|
||||||
width,
|
width,
|
||||||
}: StateCellProps) => {
|
}: StateCellProps) => {
|
||||||
const { isPending, isError, data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: [frigateQueryKeys.getFrigateHosts, id],
|
queryKey: [frigateQueryKeys.getFrigateHosts, id],
|
||||||
queryFn: frigateApi.getHosts,
|
queryFn: frigateApi.getHosts,
|
||||||
staleTime: 60 * 1000,
|
staleTime: 60 * 1000,
|
||||||
|
|||||||
@ -9825,11 +9825,6 @@ uuid@^8.3.2:
|
|||||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
||||||
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
||||||
|
|
||||||
uuid@^9.0.0:
|
|
||||||
version "9.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
|
|
||||||
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==
|
|
||||||
|
|
||||||
v8-to-istanbul@^8.1.0:
|
v8-to-istanbul@^8.1.0:
|
||||||
version "8.1.1"
|
version "8.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed"
|
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user