mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 09:15:22 +03:00
PR comments
This commit is contained in:
parent
3b44a0bfe1
commit
302803ab4f
@ -21,13 +21,13 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install --no-install-recommends -y \
|
&& apt-get -qq install --no-install-recommends -y \
|
||||||
gnupg wget unzip tzdata nginx libnginx-mod-rtmp \
|
gnupg wget unzip tzdata nginx libnginx-mod-rtmp \
|
||||||
&& apt-get -qq install --no-install-recommends -y \
|
&& apt-get -qq install --no-install-recommends -y \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
&& pip3 install -U /wheels/*.whl \
|
&& pip3 install -U /wheels/*.whl \
|
||||||
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
|
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
|
||||||
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
|
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
|
||||||
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
|
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
|
||||||
&& apt-get -qq update && apt-get -qq install --no-install-recommends -y \
|
&& apt-get -qq update && apt-get -qq install --no-install-recommends -y \
|
||||||
libedgetpu1-max=15.0 \
|
libedgetpu1-max=15.0 \
|
||||||
&& rm -rf /var/lib/apt/lists/* /wheels \
|
&& rm -rf /var/lib/apt/lists/* /wheels \
|
||||||
&& (apt-get autoremove -y; apt-get autoclean -y)
|
&& (apt-get autoremove -y; apt-get autoclean -y)
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ RUN pip3 install \
|
|||||||
voluptuous\
|
voluptuous\
|
||||||
Flask-Sockets \
|
Flask-Sockets \
|
||||||
gevent \
|
gevent \
|
||||||
gevent-websocket
|
gevent-websocket
|
||||||
|
|
||||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
|||||||
@ -57,8 +57,6 @@ class LocalObjectDetector(ObjectDetector):
|
|||||||
device_config = {"device": tf_device}
|
device_config = {"device": tf_device}
|
||||||
|
|
||||||
edge_tpu_delegate = None
|
edge_tpu_delegate = None
|
||||||
|
|
||||||
tf_device = "cpu"
|
|
||||||
|
|
||||||
if tf_device != "cpu":
|
if tf_device != "cpu":
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -32,11 +32,11 @@ export default function Dialog({ actions = [], portalRootID = 'dialogs', title,
|
|||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-2 flex justify-start flex-row-reverse space-x-2">
|
<div className="p-2 flex justify-start flex-row-reverse space-x-2">
|
||||||
{actions.map(({ color, text, onClick, ...props }, i) => (
|
{actions.map(({ color, text, onClick, ...props }, i) => (
|
||||||
<Button className="ml-2" color={color} key={i} onClick={onClick} type="text" {...props}>
|
<Button className="ml-2" color={color} key={i} onClick={onClick} type="text" {...props}>
|
||||||
{text}
|
{text}
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,6 @@ export default function Event({ eventId }) {
|
|||||||
const { data, status } = useEvent(eventId);
|
const { data, status } = useEvent(eventId);
|
||||||
const [showDialog, setShowDialog] = useState(false);
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
const [deleteStatus, setDeleteStatus] = useState(FetchStatus.NONE);
|
const [deleteStatus, setDeleteStatus] = useState(FetchStatus.NONE);
|
||||||
const [deleteMessage, setDeleteMessage] = useState();
|
|
||||||
|
|
||||||
const handleClickDelete = () => {
|
const handleClickDelete = () => {
|
||||||
setShowDialog(true);
|
setShowDialog(true);
|
||||||
@ -28,22 +27,15 @@ export default function Event({ eventId }) {
|
|||||||
|
|
||||||
const handleClickDeleteDialog = useCallback(async () => {
|
const handleClickDeleteDialog = useCallback(async () => {
|
||||||
|
|
||||||
setDeleteStatus(FetchStatus.LOADING);
|
|
||||||
let success;
|
let success;
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${apiHost}/api/events/${eventId}`, { method: 'DELETE' });
|
const response = await fetch(`${apiHost}/api/events/${eventId}`, { method: 'DELETE' });
|
||||||
const { success = false, message } = await getJSON(response)
|
success = await (response.status < 300 ? response.json() : { success: true });
|
||||||
setDeleteStatus(success ? FetchStatus.LOADED : FetchStatus.ERROR);
|
setDeleteStatus(success ? FetchStatus.LOADED : FetchStatus.ERROR);
|
||||||
setDeleteMessage(deleteEvent.message);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setDeleteStatus(FetchStatus.ERROR);
|
setDeleteStatus(FetchStatus.ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getJSON(response) {
|
|
||||||
if (response.status === 204) return {success: true};
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
setDeleteStatus(FetchStatus.LOADED);
|
setDeleteStatus(FetchStatus.LOADED);
|
||||||
setShowDialog(false);
|
setShowDialog(false);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user