From c49be0a47f4fd8ed77fdb77efb044ef20aecc0a4 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 22 May 2024 07:14:48 -0600 Subject: [PATCH] UI tweaks / fixes (#11479) * Update coloring of logs button * Fix paging after submitting * Fix sorting * Add icon --- frigate/api/event.py | 4 ++-- web/src/pages/Logs.tsx | 4 +++- web/src/pages/SubmitPlus.tsx | 10 ++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frigate/api/event.py b/frigate/api/event.py index 17fc5c776..267d13bc9 100644 --- a/frigate/api/event.py +++ b/frigate/api/event.py @@ -227,9 +227,9 @@ def events(): elif sort == "score_desc": order_by = Event.data["score"].desc() elif sort == "date_asc": - Event.start_time.asc() + order_by = Event.start_time.asc() elif sort == "date_desc": - Event.start_time.desc() + order_by = Event.start_time.desc() else: order_by = Event.start_time.desc() diff --git a/web/src/pages/Logs.tsx b/web/src/pages/Logs.tsx index cf8ed3a45..ebdcb7232 100644 --- a/web/src/pages/Logs.tsx +++ b/web/src/pages/Logs.tsx @@ -13,6 +13,7 @@ import { toast } from "sonner"; import { isDesktop } from "react-device-detect"; import ActivityIndicator from "@/components/indicators/activity-indicator"; import { cn } from "@/lib/utils"; +import { MdVerticalAlignBottom } from "react-icons/md"; const logTypes = ["frigate", "go2rtc", "nginx"] as const; type LogType = (typeof logTypes)[number]; @@ -381,7 +382,7 @@ function Logs() { {initialScroll && !endVisible && ( )} diff --git a/web/src/pages/SubmitPlus.tsx b/web/src/pages/SubmitPlus.tsx index a2c6e2221..98dd0d2f5 100644 --- a/web/src/pages/SubmitPlus.tsx +++ b/web/src/pages/SubmitPlus.tsx @@ -211,6 +211,7 @@ export default function SubmitPlus() { ...data.slice(0, pageIndex), [ ...data[pageIndex].slice(0, index), + { ...data[pageIndex][index], plus_id: "new_upload" }, ...data[pageIndex].slice(index + 1), ], ...data.slice(pageIndex + 1), @@ -275,17 +276,14 @@ export default function SubmitPlus() { - {events?.map((event, eIdx) => { - if (event.data.type != "object") { + {events?.map((event) => { + if (event.data.type != "object" || event.plus_id) { return; } - const lastRow = eIdx == events.length - 1; - return (
setUpload(event)} > @@ -324,7 +322,7 @@ export default function SubmitPlus() {
); })} - + {!isValidating && !isDone &&
} {isValidating && }