mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
fix: only show GPU power chart if power data exists
This commit is contained in:
@@ -293,7 +293,9 @@ export default function SystemDetail({ name }: { name: string }) {
|
|||||||
|
|
||||||
// if no data, show empty message
|
// if no data, show empty message
|
||||||
const dataEmpty = !chartLoading && chartData.systemStats.length === 0
|
const dataEmpty = !chartLoading && chartData.systemStats.length === 0
|
||||||
const hasGpuData = Object.keys(systemStats.at(-1)?.stats.g ?? {}).length > 0
|
const lastGpuVals = Object.values(systemStats.at(-1)?.stats.g ?? {})
|
||||||
|
const hasGpuData = lastGpuVals.length > 0
|
||||||
|
const hasGpuPowerData = lastGpuVals.some((gpu) => gpu.p !== undefined)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -489,7 +491,7 @@ export default function SystemDetail({ name }: { name: string }) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* GPU power draw chart */}
|
{/* GPU power draw chart */}
|
||||||
{hasGpuData && (
|
{hasGpuPowerData && (
|
||||||
<ChartCard
|
<ChartCard
|
||||||
empty={dataEmpty}
|
empty={dataEmpty}
|
||||||
grid={grid}
|
grid={grid}
|
||||||
|
Reference in New Issue
Block a user