mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-22 05:36:15 +01:00
site: only hide GPU engine graph if entire usage is 0% (#1624)
This commit is contained in:
@@ -407,14 +407,19 @@ export default memo(function SystemDetail({ id }: { id: string }) {
|
|||||||
let hasGpuPowerData = false
|
let hasGpuPowerData = false
|
||||||
|
|
||||||
if (lastGpus) {
|
if (lastGpus) {
|
||||||
|
// check if there are any GPUs at all
|
||||||
|
hasGpuData = Object.keys(lastGpus).length > 0
|
||||||
// check if there are any GPUs with engines
|
// check if there are any GPUs with engines
|
||||||
for (const id in lastGpus) {
|
for (let i = 0; i < systemStats.length && !hasGpuEnginesData; i++) {
|
||||||
hasGpuData = true
|
const gpus = systemStats[i].stats?.g
|
||||||
if (lastGpus[id].e !== undefined) {
|
if (!gpus) continue
|
||||||
|
for (const id in gpus) {
|
||||||
|
if (gpus[id].e !== undefined) {
|
||||||
hasGpuEnginesData = true
|
hasGpuEnginesData = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// check if there are any GPUs with power data
|
// check if there are any GPUs with power data
|
||||||
for (let i = 0; i < systemStats.length && !hasGpuPowerData; i++) {
|
for (let i = 0; i < systemStats.length && !hasGpuPowerData; i++) {
|
||||||
const gpus = systemStats[i].stats?.g
|
const gpus = systemStats[i].stats?.g
|
||||||
|
|||||||
Reference in New Issue
Block a user