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 \
|
||||
gnupg wget unzip tzdata nginx libnginx-mod-rtmp \
|
||||
&& apt-get -qq install --no-install-recommends -y \
|
||||
python3-pip \
|
||||
python3-pip \
|
||||
&& 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 \
|
||||
&& 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 \
|
||||
&& 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 \
|
||||
&& (apt-get autoremove -y; apt-get autoclean -y)
|
||||
|
||||
|
||||
@ -58,8 +58,6 @@ class LocalObjectDetector(ObjectDetector):
|
||||
|
||||
edge_tpu_delegate = None
|
||||
|
||||
tf_device = "cpu"
|
||||
|
||||
if tf_device != "cpu":
|
||||
try:
|
||||
logger.info(f"Attempting to load TPU as {device_config['device']}")
|
||||
|
||||
@ -32,11 +32,11 @@ export default function Dialog({ actions = [], portalRootID = 'dialogs', title,
|
||||
<p>{text}</p>
|
||||
</div>
|
||||
<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}>
|
||||
{text}
|
||||
</Button>
|
||||
))}
|
||||
{text}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,7 +15,6 @@ export default function Event({ eventId }) {
|
||||
const { data, status } = useEvent(eventId);
|
||||
const [showDialog, setShowDialog] = useState(false);
|
||||
const [deleteStatus, setDeleteStatus] = useState(FetchStatus.NONE);
|
||||
const [deleteMessage, setDeleteMessage] = useState();
|
||||
|
||||
const handleClickDelete = () => {
|
||||
setShowDialog(true);
|
||||
@ -28,22 +27,15 @@ export default function Event({ eventId }) {
|
||||
|
||||
const handleClickDeleteDialog = useCallback(async () => {
|
||||
|
||||
setDeleteStatus(FetchStatus.LOADING);
|
||||
let success;
|
||||
try {
|
||||
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);
|
||||
setDeleteMessage(deleteEvent.message);
|
||||
} catch (e) {
|
||||
setDeleteStatus(FetchStatus.ERROR);
|
||||
}
|
||||
|
||||
async function getJSON(response) {
|
||||
if (response.status === 204) return {success: true};
|
||||
return response.json();
|
||||
}
|
||||
|
||||
if (success) {
|
||||
setDeleteStatus(FetchStatus.LOADED);
|
||||
setShowDialog(false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user