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",
|
||||
"@types/strftime": "^0.9.8",
|
||||
"@types/uuid": "^9.0.2",
|
||||
"@types/video.js": "^7.3.56",
|
||||
"uuid": "^9.0.0"
|
||||
"@types/video.js": "^7.3.56"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
import { Flex, Grid, Group, 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 { Flex, Grid, TextInput } from '@mantine/core';
|
||||
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 CenterLoader from '../shared/components/loaders/CenterLoader';
|
||||
import CameraCard from '../widgets/CameraCard';
|
||||
import RetryErrorPage from './RetryErrorPage';
|
||||
|
||||
const MainPage = () => {
|
||||
const executed = useRef(false)
|
||||
const { sideBarsStore } = useContext(Context)
|
||||
const [searchQuery, setSearchQuery] = useState<string>()
|
||||
const [filteredCameras, setFilteredCameras] = useState<GetCameraWHostWConfig[]>()
|
||||
@ -30,28 +30,37 @@ const MainPage = () => {
|
||||
}, [searchQuery, cameras])
|
||||
|
||||
useEffect(() => {
|
||||
sideBarsStore.rightVisible = false
|
||||
sideBarsStore.setLeftChildren(null)
|
||||
sideBarsStore.setRightChildren(null)
|
||||
}, [])
|
||||
if (!executed.current) {
|
||||
sideBarsStore.rightVisible = false
|
||||
sideBarsStore.setLeftChildren(null)
|
||||
sideBarsStore.setRightChildren(null)
|
||||
executed.current = true
|
||||
}
|
||||
}, [sideBarsStore])
|
||||
|
||||
const cards = useMemo(() => {
|
||||
if (filteredCameras)
|
||||
return filteredCameras.map(camera => (
|
||||
return filteredCameras.filter(camera => {
|
||||
if (camera.frigateHost && !camera.frigateHost.enabled) return false
|
||||
return true
|
||||
}).map(camera => (
|
||||
<CameraCard
|
||||
key={camera.id}
|
||||
camera={camera}
|
||||
/>)
|
||||
)
|
||||
else
|
||||
return cameras?.map(
|
||||
camera => (
|
||||
<CameraCard
|
||||
key={camera.id}
|
||||
camera={camera}
|
||||
/>)
|
||||
else if (cameras)
|
||||
return cameras.filter(camera => {
|
||||
if (camera.frigateHost && !camera.frigateHost.enabled) return false
|
||||
return true
|
||||
}).map(camera => (
|
||||
<CameraCard
|
||||
key={camera.id}
|
||||
camera={camera}
|
||||
/>)
|
||||
)
|
||||
}, [cameras, filteredCameras, searchQuery])
|
||||
else return []
|
||||
}, [cameras, filteredCameras])
|
||||
|
||||
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 { Button, Flex, Grid, Group, Indicator, Paper, Skeleton } from '@mantine/core';
|
||||
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 { useContext, useEffect, useRef } from 'react';
|
||||
import { Context } from '..';
|
||||
import HeadSearch from '../shared/components/inputs/HeadSearch';
|
||||
import TestItem from './TestItem';
|
||||
|
||||
const Test = () => {
|
||||
const [value, setValue] = useState<[Date | null, Date | null]>([null, null])
|
||||
const executed = useRef(false)
|
||||
|
||||
const { sideBarsStore } = useContext(Context)
|
||||
sideBarsStore.rightVisible = true
|
||||
|
||||
useEffect(() => {
|
||||
sideBarsStore.rightVisible = true
|
||||
return () => {
|
||||
sideBarsStore.rightVisible = false
|
||||
if (!executed.current) {
|
||||
sideBarsStore.rightVisible = false
|
||||
sideBarsStore.setLeftChildren(null)
|
||||
sideBarsStore.setRightChildren(null)
|
||||
executed.current = true
|
||||
}
|
||||
}, [])
|
||||
}, [sideBarsStore])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('value', value)
|
||||
}, [value])
|
||||
|
||||
const handleClick = () => {
|
||||
const startOfDay = new Date();
|
||||
startOfDay.setHours(0, 0, 0, 0);
|
||||
setValue([startOfDay, startOfDay])
|
||||
}
|
||||
// const handleClick = () => {
|
||||
// const startOfDay = new Date();
|
||||
// startOfDay.setHours(0, 0, 0, 0);
|
||||
// setValue([startOfDay, startOfDay])
|
||||
// }
|
||||
|
||||
const cards = (qty: number) => {
|
||||
let items = []
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { Burger, createStyles, Header, rem, Menu, Container, Group, Button, Flex } from "@mantine/core";
|
||||
import { useDisclosure, useMediaQuery } from "@mantine/hooks";
|
||||
import UserMenu from '../../shared/components/UserMenu';
|
||||
import { Button, Container, Flex, Group, Header, Menu, createStyles, rem } from "@mantine/core";
|
||||
import { useAuth } from 'react-oidc-context';
|
||||
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 Logo from "../../shared/components/images/LogoImage";
|
||||
import { routesPath } from "../../router/routes.path";
|
||||
import DrawerMenu from "../../shared/components/menu/DrawerMenu";
|
||||
import { useAdminRole } from "../../hooks/useAdminRole";
|
||||
|
||||
const HEADER_HEIGHT = rem(60)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { routesPath } from "../../router/routes.path";
|
||||
import { headerMenu } from "../../shared/strings/header.menu.strings";
|
||||
import { HeaderActionProps, LinkItem } from "./HeaderAction";
|
||||
import { LinkItem } from "./HeaderAction";
|
||||
|
||||
export const headerLinks: LinkItem[] = [
|
||||
{ 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 React from 'react';
|
||||
import { frigateApi, frigateQueryKeys } from '../../services/frigate.proxy/frigate.api';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { frigateApi, frigateQueryKeys } from '../../services/frigate.proxy/frigate.api';
|
||||
|
||||
interface StateCellProps {
|
||||
id?: string
|
||||
@ -12,7 +11,7 @@ const StateCell = ({
|
||||
id,
|
||||
width,
|
||||
}: StateCellProps) => {
|
||||
const { isPending, isError, data } = useQuery({
|
||||
const { data } = useQuery({
|
||||
queryKey: [frigateQueryKeys.getFrigateHosts, id],
|
||||
queryFn: frigateApi.getHosts,
|
||||
staleTime: 60 * 1000,
|
||||
|
||||
@ -9825,11 +9825,6 @@ uuid@^8.3.2:
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
||||
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:
|
||||
version "8.1.1"
|
||||
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user