From 09f2f01319876be96af141e92b9b43d7ccfc35ba Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 4 Apr 2024 07:54:37 -0600 Subject: [PATCH] Rename graph --- web/src/components/graph/SystemGraph.tsx | 6 +++--- web/src/pages/System.tsx | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index ec750dceb..e999c36d4 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -5,7 +5,7 @@ import { useCallback, useEffect, useMemo } from "react"; import Chart from "react-apexcharts"; import useSWR from "swr"; -type SystemGraphProps = { +type ThresholdBarGraphProps = { graphId: string; name: string; unit: string; @@ -13,14 +13,14 @@ type SystemGraphProps = { updateTimes: number[]; data: ApexAxisChartSeries; }; -export default function SystemGraph({ +export function ThresholdBarGraph({ graphId, name, unit, threshold, updateTimes, data, -}: SystemGraphProps) { +}: ThresholdBarGraphProps) { const { data: config } = useSWR("config", { revalidateOnFocus: false, }); diff --git a/web/src/pages/System.tsx b/web/src/pages/System.tsx index 9412ad1c1..46516cd1d 100644 --- a/web/src/pages/System.tsx +++ b/web/src/pages/System.tsx @@ -1,7 +1,6 @@ import useSWR from "swr"; import { FrigateStats } from "@/types/stats"; import { useEffect, useMemo, useState } from "react"; -import SystemGraph from "@/components/graph/SystemGraph"; import { useFrigateStats } from "@/api/ws"; import TimeAgo from "@/components/dynamic/TimeAgo"; import { @@ -14,6 +13,8 @@ import { import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { Button } from "@/components/ui/button"; import VainfoDialog from "@/components/overlay/VainfoDialog"; +import { isDesktop } from "react-device-detect"; +import { ThresholdBarGraph } from "@/components/graph/SystemGraph"; const metrics = ["general", "storage", "cameras"] as const; type SystemMetric = (typeof metrics)[number]; @@ -59,7 +60,8 @@ function System() {
{lastUpdated && (
- Last refreshed: + {isDesktop && "Last refreshed: "} +
)}
@@ -182,13 +184,13 @@ export default System; if (camera.enabled) { return (
- -
Detector Inference Speed
{detInferenceTimeSeries.map((series) => ( -
Detector CPU Usage
{detCpuSeries.map((series) => ( -
Detector Memory Usage
{detMemSeries.map((series) => ( -
GPU Usage
{gpuSeries.map((series) => ( -
GPU Memory
{gpuMemSeries.map((series) => ( -
Process CPU Usage
{otherProcessCpuSeries.map((series) => ( -
Process Memory Usage
{otherProcessMemSeries.map((series) => ( -