mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
UI changes and fixes (#14516)
* Add camera webui link to debug view * fix optimistic description update * simplify * clean up * params
This commit is contained in:
parent
828fdbfd2d
commit
c7d9f83638
@ -321,22 +321,16 @@ function ObjectDetailsTab({
|
|||||||
(key.includes("events") ||
|
(key.includes("events") ||
|
||||||
key.includes("events/search") ||
|
key.includes("events/search") ||
|
||||||
key.includes("events/explore")),
|
key.includes("events/explore")),
|
||||||
(currentData: SearchResult[][] | undefined) => {
|
(currentData: SearchResult[][] | SearchResult[] | undefined) => {
|
||||||
if (!currentData) return currentData;
|
if (!currentData) return currentData;
|
||||||
// optimistic update
|
// optimistic update
|
||||||
return currentData.map((page) =>
|
return currentData
|
||||||
page.map((event) =>
|
.flat()
|
||||||
|
.map((event) =>
|
||||||
event.id === search.id
|
event.id === search.id
|
||||||
? {
|
? { ...event, data: { ...event.data, description: desc } }
|
||||||
...event,
|
|
||||||
data: {
|
|
||||||
...event.data,
|
|
||||||
description: desc,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: event,
|
: event,
|
||||||
),
|
);
|
||||||
);
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
optimisticData: true,
|
optimisticData: true,
|
||||||
|
@ -21,7 +21,8 @@ import useDeepMemo from "@/hooks/use-deep-memo";
|
|||||||
import { Card } from "@/components/ui/card";
|
import { Card } from "@/components/ui/card";
|
||||||
import { getIconForLabel } from "@/utils/iconUtil";
|
import { getIconForLabel } from "@/utils/iconUtil";
|
||||||
import { capitalizeFirstLetter } from "@/utils/stringUtil";
|
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 = {
|
type ObjectSettingsViewProps = {
|
||||||
selectedCamera?: string;
|
selectedCamera?: string;
|
||||||
@ -187,6 +188,21 @@ export default function ObjectSettingsView({
|
|||||||
objects.
|
objects.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{config?.cameras[cameraConfig.name]?.webui_url && (
|
||||||
|
<div className="mb-5 text-sm text-muted-foreground">
|
||||||
|
<div className="mt-2 flex flex-row items-center text-primary">
|
||||||
|
<Link
|
||||||
|
to={config?.cameras[cameraConfig.name]?.webui_url ?? ""}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="inline"
|
||||||
|
>
|
||||||
|
Open {capitalizeFirstLetter(cameraConfig.name)}'s Web UI
|
||||||
|
<LuExternalLink className="ml-2 inline-flex size-3" />
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<Tabs defaultValue="debug" className="w-full">
|
<Tabs defaultValue="debug" className="w-full">
|
||||||
<TabsList className="grid w-full grid-cols-2">
|
<TabsList className="grid w-full grid-cols-2">
|
||||||
|
Loading…
Reference in New Issue
Block a user