This commit is contained in:
Nicolas Mowen 2026-05-13 14:59:31 -06:00
parent 6f266256c6
commit 67d9f7d6ae

View File

@ -1,5 +1,5 @@
import useSWR from "swr"; import useSWR from "swr";
import { FrigateStats, GpuInfo } from "@/types/stats"; import { FrigateStats, GpuInfo, GpuStats } from "@/types/stats";
import { startTransition, useEffect, useMemo, useState } from "react"; import { startTransition, useEffect, useMemo, useState } from "react";
import { useFrigateStats } from "@/api/ws"; import { useFrigateStats } from "@/api/ws";
import { import {
@ -288,8 +288,9 @@ export default function GeneralMetrics({
// Intel doesn't expose VRAM usage, so hide the memory section // Intel doesn't expose VRAM usage, so hide the memory section
// entirely when every reporting GPU is Intel. // entirely when every reporting GPU is Intel.
const firstUsages = statsHistory[0]?.gpu_usages ?? {}; const firstEntries: GpuStats[] = Object.values(
const firstEntries = Object.values(firstUsages); statsHistory[0]?.gpu_usages ?? {},
);
if ( if (
firstEntries.length > 0 && firstEntries.length > 0 &&
firstEntries.every((s) => s.vendor === "intel") firstEntries.every((s) => s.vendor === "intel")