Merge branch 'dev' of https://github.com/blakeblackshear/frigate into improve-devcontainer

This commit is contained in:
Felipe Santos 2022-11-17 15:51:24 -03:00
commit 63684b51ce
13 changed files with 340 additions and 92 deletions

View File

@ -119,7 +119,7 @@ RUN --mount=type=bind,from=wheels,source=/wheels,target=/wheels \
ENV PATH=$PATH:/usr/lib/btbn-ffmpeg/bin
# install go2rtc
RUN wget -O go2rtc "https://github.com/AlexxIT/go2rtc/releases/download/v0.1-rc.2/go2rtc_linux_${TARGETARCH}" \
RUN wget -O go2rtc "https://github.com/AlexxIT/go2rtc/releases/download/v0.1-rc.3/go2rtc_linux_${TARGETARCH}" \
&& chmod +x go2rtc \
&& mkdir -p /usr/local/go2rtc/sbin/ \
&& mv go2rtc /usr/local/go2rtc/sbin/go2rtc

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/with-contenv bash
# https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425?permalink_comment_id=3945021
set -euo pipefail

View File

@ -233,7 +233,7 @@ http {
sub_filter '"/BASE_PATH/dist/' '"$http_x_ingress_path/dist/';
sub_filter '"/BASE_PATH/js/' '"$http_x_ingress_path/js/';
sub_filter '"/BASE_PATH/assets/' '"$http_x_ingress_path/assets/';
sub_filter '="/BASE_PATH/"' '=window.baseUrl';
sub_filter 'return"/BASE_PATH/"' 'return window.baseUrl';
sub_filter '<body>' '<body><script>window.baseUrl="$http_x_ingress_path/";</script>';
sub_filter_types text/css application/javascript;
sub_filter_once off;

View File

@ -354,7 +354,7 @@ restream:
# Optional: Enable the restream (default: True)
enabled: True
# Optional: Force audio compatibility with browsers (default: shown below)
force_audio: False
force_audio: True
# Optional: jsmpeg stream configuration for WebUI
jsmpeg:
# Optional: Set the height of the jsmpeg stream. (default: 720)

24
docs/package-lock.json generated
View File

@ -7497,9 +7497,9 @@
}
},
"node_modules/loader-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz",
"integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
@ -9346,9 +9346,9 @@
}
},
"node_modules/react-dev-utils/node_modules/loader-utils": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.0.tgz",
"integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ==",
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz",
"integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==",
"engines": {
"node": ">= 12.13.0"
}
@ -17724,9 +17724,9 @@
"integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw=="
},
"loader-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz",
"integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
@ -18992,9 +18992,9 @@
}
},
"loader-utils": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.0.tgz",
"integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ=="
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz",
"integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw=="
},
"locate-path": {
"version": "6.0.0",

View File

@ -536,7 +536,7 @@ class JsmpegStreamConfig(FrigateBaseModel):
class RestreamConfig(FrigateBaseModel):
enabled: bool = Field(default=True, title="Restreaming enabled.")
force_audio: bool = Field(
default=False, title="Force audio compatibility with the browser."
default=True, title="Force audio compatibility with the browser."
)
jsmpeg: JsmpegStreamConfig = Field(
default_factory=JsmpegStreamConfig, title="Jsmpeg Stream Configuration."

View File

@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
def get_manual_go2rtc_stream(camera_url: str) -> str:
"""Get a manual stream for go2rtc."""
return f"exec: /usr/lib/btbn-ffmpeg/bin/ffmpeg -i {camera_url} -c:v copy -c:a libopus -rtsp_transport tcp -f rtsp {{output}}"
return f"ffmpeg:{camera_url}#video=copy#audio=aac#audio=opus"
class RestreamApi:

View File

@ -25,6 +25,7 @@ class TestRestream(TestCase):
},
"restream": {
"enabled": True,
"force_audio": False,
},
},
"front": {

333
web/package-lock.json generated
View File

@ -13,7 +13,7 @@
"date-fns": "^2.29.3",
"idb-keyval": "^6.2.0",
"immer": "^9.0.16",
"preact": "^10.11.2",
"preact": "^10.11.3",
"preact-async-route": "^2.2.1",
"preact-router": "^4.1.0",
"react": "npm:@preact/compat@^17.1.2",
@ -31,7 +31,7 @@
"@testing-library/user-event": "^14.4.3",
"@types/video.js": "^7.3.49",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@typescript-eslint/parser": "^5.43.0",
"@vitest/coverage-c8": "^0.25.1",
"@vitest/ui": "^0.25.1",
"autoprefixer": "^10.4.13",
@ -41,13 +41,13 @@
"eslint-plugin-vitest-globals": "^1.2.0",
"fake-indexeddb": "^4.0.0",
"jsdom": "^20.0.2",
"msw": "^0.48.1",
"msw": "^0.48.3",
"postcss": "^8.4.19",
"prettier": "^2.7.1",
"tailwindcss": "^3.2.3",
"tailwindcss": "^3.2.4",
"typescript": "^4.8.4",
"vite": "^3.2.3",
"vitest": "^0.25.1"
"vite": "^3.2.4",
"vitest": "^0.25.2"
}
},
"node_modules/@adobe/css-tools": {
@ -1503,14 +1503,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "5.42.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.1.tgz",
"integrity": "sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q==",
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.43.0.tgz",
"integrity": "sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "5.42.1",
"@typescript-eslint/types": "5.42.1",
"@typescript-eslint/typescript-estree": "5.42.1",
"@typescript-eslint/scope-manager": "5.43.0",
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/typescript-estree": "5.43.0",
"debug": "^4.3.4"
},
"engines": {
@ -1529,6 +1529,95 @@
}
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz",
"integrity": "sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/visitor-keys": "5.43.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.43.0.tgz",
"integrity": "sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz",
"integrity": "sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/visitor-keys": "5.43.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz",
"integrity": "sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.43.0",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/parser/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "5.42.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.1.tgz",
@ -1767,6 +1856,61 @@
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vitest/coverage-c8/node_modules/vitest": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.1.tgz",
"integrity": "sha512-eH74h6MkuEgsqR4mAQZeMK9O0PROiKY+i+1GMz/fBi5A3L2ml5U7JQs7LfPU7+uWUziZyLHagl+rkyfR8SLhlA==",
"dev": true,
"dependencies": {
"@types/chai": "^4.3.3",
"@types/chai-subset": "^1.3.3",
"@types/node": "*",
"acorn": "^8.8.0",
"acorn-walk": "^8.2.0",
"chai": "^4.3.6",
"debug": "^4.3.4",
"local-pkg": "^0.4.2",
"source-map": "^0.6.1",
"strip-literal": "^0.4.2",
"tinybench": "^2.3.1",
"tinypool": "^0.3.0",
"tinyspy": "^1.0.2",
"vite": "^3.0.0"
},
"bin": {
"vitest": "vitest.mjs"
},
"engines": {
"node": ">=v14.16.0"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@edge-runtime/vm": "*",
"@vitest/browser": "*",
"@vitest/ui": "*",
"happy-dom": "*",
"jsdom": "*"
},
"peerDependenciesMeta": {
"@edge-runtime/vm": {
"optional": true
},
"@vitest/browser": {
"optional": true
},
"@vitest/ui": {
"optional": true
},
"happy-dom": {
"optional": true
},
"jsdom": {
"optional": true
}
}
},
"node_modules/@vitest/ui": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.25.1.tgz",
@ -6280,9 +6424,9 @@
"dev": true
},
"node_modules/msw": {
"version": "0.48.1",
"resolved": "https://registry.npmjs.org/msw/-/msw-0.48.1.tgz",
"integrity": "sha512-lnhIsC5aQOpqu5CjJ11CPl6RYGbY9+LhZZw1zKX3S710O9qGQ7kftmfX1FifmZNk2FuKoygprKITSfqHWpE5LQ==",
"version": "0.48.3",
"resolved": "https://registry.npmjs.org/msw/-/msw-0.48.3.tgz",
"integrity": "sha512-8ENBcX7JVWPA5v9WTeOnCWCMOVtyBiXZyD/0+AKlhOysJRB1ZdBAcMGLIiQ2/VpQ2lC0Yd7SFKg9aviAQSVeaw==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
@ -6302,7 +6446,6 @@
"node-fetch": "^2.6.7",
"outvariant": "^1.3.0",
"path-to-regexp": "^6.2.0",
"statuses": "^2.0.0",
"strict-event-emitter": "^0.2.6",
"type-fest": "^2.19.0",
"yargs": "^17.3.1"
@ -7057,9 +7200,9 @@
"dev": true
},
"node_modules/preact": {
"version": "10.11.2",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.11.2.tgz",
"integrity": "sha512-skAwGDFmgxhq1DCBHke/9e12ewkhc7WYwjuhHB8HHS8zkdtITXLRmUMTeol2ldxvLwYtwbFeifZ9uDDWuyL4Iw==",
"version": "10.11.3",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.11.3.tgz",
"integrity": "sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
@ -7694,15 +7837,6 @@
"node": ">=8"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/strict-event-emitter": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.2.8.tgz",
@ -7896,9 +8030,9 @@
}
},
"node_modules/tailwindcss": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.3.tgz",
"integrity": "sha512-Xt9D4PK4zuuQCEB8bwK9JUCKmTgUwyac/6b0/42Vqhgl6YJkep+Wf5wq+5uXYfmrupdAD0YY2NY1hyZp1HjRrg==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
"integrity": "sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==",
"dev": true,
"dependencies": {
"arg": "^5.0.2",
@ -8394,9 +8528,9 @@
}
},
"node_modules/vite": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.3.tgz",
"integrity": "sha512-h8jl1TZ76eGs3o2dIBSsvXDLb1m/Ec1iej8ZMdz+PsaFUsftZeWe2CZOI3qogEsMNaywc17gu0q6cQDzh/weCQ==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.4.tgz",
"integrity": "sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==",
"dev": true,
"dependencies": {
"esbuild": "^0.15.9",
@ -8443,9 +8577,9 @@
}
},
"node_modules/vitest": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.1.tgz",
"integrity": "sha512-eH74h6MkuEgsqR4mAQZeMK9O0PROiKY+i+1GMz/fBi5A3L2ml5U7JQs7LfPU7+uWUziZyLHagl+rkyfR8SLhlA==",
"version": "0.25.2",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.2.tgz",
"integrity": "sha512-qqkzfzglEFbQY7IGkgSJkdOhoqHjwAao/OrphnHboeYHC5JzsVFoLCaB2lnAy8krhj7sbrFTVRApzpkTOeuDWQ==",
"dev": true,
"dependencies": {
"@types/chai": "^4.3.3",
@ -9934,15 +10068,67 @@
}
},
"@typescript-eslint/parser": {
"version": "5.42.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.1.tgz",
"integrity": "sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q==",
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.43.0.tgz",
"integrity": "sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.42.1",
"@typescript-eslint/types": "5.42.1",
"@typescript-eslint/typescript-estree": "5.42.1",
"@typescript-eslint/scope-manager": "5.43.0",
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/typescript-estree": "5.43.0",
"debug": "^4.3.4"
},
"dependencies": {
"@typescript-eslint/scope-manager": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz",
"integrity": "sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/visitor-keys": "5.43.0"
}
},
"@typescript-eslint/types": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.43.0.tgz",
"integrity": "sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz",
"integrity": "sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.43.0",
"@typescript-eslint/visitor-keys": "5.43.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz",
"integrity": "sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.43.0",
"eslint-visitor-keys": "^3.3.0"
}
},
"semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"@typescript-eslint/scope-manager": {
@ -10095,6 +10281,30 @@
"requires": {
"c8": "^7.12.0",
"vitest": "0.25.1"
},
"dependencies": {
"vitest": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.1.tgz",
"integrity": "sha512-eH74h6MkuEgsqR4mAQZeMK9O0PROiKY+i+1GMz/fBi5A3L2ml5U7JQs7LfPU7+uWUziZyLHagl+rkyfR8SLhlA==",
"dev": true,
"requires": {
"@types/chai": "^4.3.3",
"@types/chai-subset": "^1.3.3",
"@types/node": "*",
"acorn": "^8.8.0",
"acorn-walk": "^8.2.0",
"chai": "^4.3.6",
"debug": "^4.3.4",
"local-pkg": "^0.4.2",
"source-map": "^0.6.1",
"strip-literal": "^0.4.2",
"tinybench": "^2.3.1",
"tinypool": "^0.3.0",
"tinyspy": "^1.0.2",
"vite": "^3.0.0"
}
}
}
},
"@vitest/ui": {
@ -13352,9 +13562,9 @@
"dev": true
},
"msw": {
"version": "0.48.1",
"resolved": "https://registry.npmjs.org/msw/-/msw-0.48.1.tgz",
"integrity": "sha512-lnhIsC5aQOpqu5CjJ11CPl6RYGbY9+LhZZw1zKX3S710O9qGQ7kftmfX1FifmZNk2FuKoygprKITSfqHWpE5LQ==",
"version": "0.48.3",
"resolved": "https://registry.npmjs.org/msw/-/msw-0.48.3.tgz",
"integrity": "sha512-8ENBcX7JVWPA5v9WTeOnCWCMOVtyBiXZyD/0+AKlhOysJRB1ZdBAcMGLIiQ2/VpQ2lC0Yd7SFKg9aviAQSVeaw==",
"dev": true,
"requires": {
"@mswjs/cookies": "^0.2.2",
@ -13373,7 +13583,6 @@
"node-fetch": "^2.6.7",
"outvariant": "^1.3.0",
"path-to-regexp": "^6.2.0",
"statuses": "^2.0.0",
"strict-event-emitter": "^0.2.6",
"type-fest": "^2.19.0",
"yargs": "^17.3.1"
@ -13876,9 +14085,9 @@
"dev": true
},
"preact": {
"version": "10.11.2",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.11.2.tgz",
"integrity": "sha512-skAwGDFmgxhq1DCBHke/9e12ewkhc7WYwjuhHB8HHS8zkdtITXLRmUMTeol2ldxvLwYtwbFeifZ9uDDWuyL4Iw=="
"version": "10.11.3",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.11.3.tgz",
"integrity": "sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg=="
},
"preact-async-route": {
"version": "2.2.1",
@ -14352,12 +14561,6 @@
}
}
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"dev": true
},
"strict-event-emitter": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.2.8.tgz",
@ -14510,9 +14713,9 @@
}
},
"tailwindcss": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.3.tgz",
"integrity": "sha512-Xt9D4PK4zuuQCEB8bwK9JUCKmTgUwyac/6b0/42Vqhgl6YJkep+Wf5wq+5uXYfmrupdAD0YY2NY1hyZp1HjRrg==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
"integrity": "sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==",
"dev": true,
"requires": {
"arg": "^5.0.2",
@ -14904,9 +15107,9 @@
}
},
"vite": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.3.tgz",
"integrity": "sha512-h8jl1TZ76eGs3o2dIBSsvXDLb1m/Ec1iej8ZMdz+PsaFUsftZeWe2CZOI3qogEsMNaywc17gu0q6cQDzh/weCQ==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.4.tgz",
"integrity": "sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==",
"dev": true,
"requires": {
"esbuild": "^0.15.9",
@ -14917,9 +15120,9 @@
}
},
"vitest": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.1.tgz",
"integrity": "sha512-eH74h6MkuEgsqR4mAQZeMK9O0PROiKY+i+1GMz/fBi5A3L2ml5U7JQs7LfPU7+uWUziZyLHagl+rkyfR8SLhlA==",
"version": "0.25.2",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.2.tgz",
"integrity": "sha512-qqkzfzglEFbQY7IGkgSJkdOhoqHjwAao/OrphnHboeYHC5JzsVFoLCaB2lnAy8krhj7sbrFTVRApzpkTOeuDWQ==",
"dev": true,
"requires": {
"@types/chai": "^4.3.3",

View File

@ -17,7 +17,7 @@
"date-fns": "^2.29.3",
"idb-keyval": "^6.2.0",
"immer": "^9.0.16",
"preact": "^10.11.2",
"preact": "^10.11.3",
"preact-async-route": "^2.2.1",
"preact-router": "^4.1.0",
"react": "npm:@preact/compat@^17.1.2",
@ -35,7 +35,7 @@
"@testing-library/user-event": "^14.4.3",
"@types/video.js": "^7.3.49",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@typescript-eslint/parser": "^5.43.0",
"@vitest/coverage-c8": "^0.25.1",
"@vitest/ui": "^0.25.1",
"autoprefixer": "^10.4.13",
@ -45,12 +45,12 @@
"eslint-plugin-vitest-globals": "^1.2.0",
"fake-indexeddb": "^4.0.0",
"jsdom": "^20.0.2",
"msw": "^0.48.1",
"msw": "^0.48.3",
"postcss": "^8.4.19",
"prettier": "^2.7.1",
"tailwindcss": "^3.2.3",
"tailwindcss": "^3.2.4",
"typescript": "^4.8.4",
"vite": "^3.2.3",
"vitest": "^0.25.1"
"vite": "^3.2.4",
"vitest": "^0.25.2"
}
}

View File

@ -200,12 +200,25 @@ ${Object.keys(objectMaskPoints)
<div className="flex-col space-y-4 p-2 px-4">
<Heading size="2xl">{camera} mask & zone creator</Heading>
<Card
content={
<div>
<p>This tool can help you create masks & zones for your {camera} camera.</p>
<ul>
<li>Click to add a point.</li>
<li>Click and hold on an existing point to move it.</li>
<li>Right-Click on an existing point to delete it.</li>
</ul>
</div>
}
header="Instructions"
/>
<Card
content={
<p>
This tool can help you create masks & zones for your {camera} camera. When done, copy each mask
configuration into your <code className="font-mono">config.yml</code> file restart your Frigate instance to
save your changes.
When done, copy each mask configuration into your <code className="font-mono">config.yml</code> file
restart your Frigate instance to save your changes.
</p>
}
header="Warning"

View File

@ -54,6 +54,10 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
const selectedDayRecordingData = recordingsSummary.find((s) => !date || s.day === date);
if (!selectedDayRecordingData) {
return [];
}
const [year, month, day] = selectedDayRecordingData.day.split('-');
return selectedDayRecordingData.hours
.map((h) => {

View File

@ -0,0 +1,27 @@
import { h } from 'preact';
import * as CameraImage from '../../components/CameraImage';
import * as Mqtt from '../../api/mqtt';
import Cameras from '../Cameras';
import { render, screen, waitForElementToBeRemoved } from 'testing-library';
describe('Recording Route', () => {
beforeEach(() => {
vi.spyOn(CameraImage, 'default').mockImplementation(() => <div data-testid="camera-image" />);
vi.spyOn(Mqtt, 'useMqtt').mockImplementation(() => ({ value: { payload: 'OFF' }, send: jest.fn() }));
});
test('shows an ActivityIndicator if not yet loaded', async () => {
render(<Cameras />);
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
});
test('shows no recordings warning', async () => {
render(<Cameras />);
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
expect(screen.queryAllByText('No Recordings Found')).toHaveLength(0);
});
});