From c7d9f8363838093ef7a5cab4e29c49b7bf6165d1 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:11:05 -0500 Subject: [PATCH] UI changes and fixes (#14516) * Add camera webui link to debug view * fix optimistic description update * simplify * clean up * params --- .../overlay/detail/SearchDetailDialog.tsx | 18 ++++++------------ web/src/views/settings/ObjectSettingsView.tsx | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx index bbe82a0e2..a307e6668 100644 --- a/web/src/components/overlay/detail/SearchDetailDialog.tsx +++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx @@ -321,22 +321,16 @@ function ObjectDetailsTab({ (key.includes("events") || key.includes("events/search") || key.includes("events/explore")), - (currentData: SearchResult[][] | undefined) => { + (currentData: SearchResult[][] | SearchResult[] | undefined) => { if (!currentData) return currentData; // optimistic update - return currentData.map((page) => - page.map((event) => + return currentData + .flat() + .map((event) => event.id === search.id - ? { - ...event, - data: { - ...event.data, - description: desc, - }, - } + ? { ...event, data: { ...event.data, description: desc } } : event, - ), - ); + ); }, { optimisticData: true, diff --git a/web/src/views/settings/ObjectSettingsView.tsx b/web/src/views/settings/ObjectSettingsView.tsx index 66962cca7..7b8a08d2e 100644 --- a/web/src/views/settings/ObjectSettingsView.tsx +++ b/web/src/views/settings/ObjectSettingsView.tsx @@ -21,7 +21,8 @@ import useDeepMemo from "@/hooks/use-deep-memo"; import { Card } from "@/components/ui/card"; import { getIconForLabel } from "@/utils/iconUtil"; import { capitalizeFirstLetter } from "@/utils/stringUtil"; -import { LuInfo } from "react-icons/lu"; +import { LuExternalLink, LuInfo } from "react-icons/lu"; +import { Link } from "react-router-dom"; type ObjectSettingsViewProps = { selectedCamera?: string; @@ -187,6 +188,21 @@ export default function ObjectSettingsView({ objects.
+ {config?.cameras[cameraConfig.name]?.webui_url && ( +