mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-27 06:48:58 +03:00
Improve System Health pane (#24188)
* build out system health pane * tweaks * fixes * fix notice link so it opens the correct camera * tweak language
This commit is contained in:
committed by
Nicolas Mowen
parent
6d33b31bc6
commit
70ce193e09
@@ -705,7 +705,9 @@ export default function Settings() {
|
||||
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order);
|
||||
}, [config]);
|
||||
|
||||
const [selectedCamera, setSelectedCamera] = useState<string>("");
|
||||
const [selectedCamera, setSelectedCamera] = useState<string>(
|
||||
() => searchParams.get("camera") ?? "",
|
||||
);
|
||||
|
||||
// Get all camera overrides for the selected camera
|
||||
const cameraOverrides = useAllCameraOverrides(config, selectedCamera);
|
||||
@@ -1164,6 +1166,12 @@ export default function Settings() {
|
||||
});
|
||||
|
||||
useSearchEffect("camera", (camera: string) => {
|
||||
// the config drives the camera list, so keep the param until it loads
|
||||
// rather than consuming it against an empty list
|
||||
if (cameras.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const cameraNames = cameras.map((c) => c.name);
|
||||
if (cameraNames.includes(camera)) {
|
||||
setSelectedCamera(camera);
|
||||
|
||||
@@ -122,7 +122,7 @@ function System() {
|
||||
</ToggleGroup>
|
||||
|
||||
<div className="flex h-full items-center">
|
||||
{lastUpdated && (
|
||||
{lastUpdated && pageToggle != "health" && (
|
||||
<div className="h-full content-center text-sm text-muted-foreground">
|
||||
{t("lastRefreshed")}
|
||||
<TimeAgo time={lastUpdated * 1000} dense />
|
||||
|
||||
Reference in New Issue
Block a user