varaverk: CPU canvas 36→60px; add GPU history chart at 60px

This commit is contained in:
Gmer4Lfe
2026-05-24 11:15:31 -04:00
parent 496d70c137
commit 423a8e3e0a
@@ -71,6 +71,7 @@ function vvMeter(label, pct, text) {
const VV_HIST_MAX = 24; // 24 × 5 s = 120 s const VV_HIST_MAX = 24; // 24 × 5 s = 120 s
let vvCpuHistory = []; let vvCpuHistory = [];
let vvGpuHistory = [];
let vvNetRxHistory = []; let vvNetRxHistory = [];
let vvNetTxHistory = []; let vvNetTxHistory = [];
@@ -222,7 +223,7 @@ function vvRenderCpu(cpu) {
} }
// Canvas chart // Canvas chart
html += `<canvas id="vv-cpu-canvas" style="width:100%;height:36px;display:block;"></canvas>`; html += `<canvas id="vv-cpu-canvas" style="width:100%;height:60px;display:block;"></canvas>`;
return html; return html;
} }
@@ -388,12 +389,17 @@ function vvPollMonitor() {
vvMeter('GPU', utilPct, `${utilPct}%`) + vvMeter('GPU', utilPct, `${utilPct}%`) +
vvMeter('Encode', gpu.enc_pct ?? 0, `${gpu.enc_pct ?? 0}%`) + vvMeter('Encode', gpu.enc_pct ?? 0, `${gpu.enc_pct ?? 0}%`) +
vvMeter('Decode', gpu.dec_pct ?? 0, `${gpu.dec_pct ?? 0}%`) + vvMeter('Decode', gpu.dec_pct ?? 0, `${gpu.dec_pct ?? 0}%`) +
`<div style="display:flex;justify-content:space-between;font-size:11px;margin-top:6px;"> `<div style="display:flex;justify-content:space-between;font-size:11px;margin-top:6px;margin-bottom:8px;">
<span style="color:#666;">Temp</span> <span style="color:#666;">Temp</span>
<span style="color:${tempColor};font-weight:bold;">${temp}°C</span> <span style="color:${tempColor};font-weight:bold;">${temp}°C</span>
<span style="color:#666;margin-left:12px;">Power</span> <span style="color:#666;margin-left:12px;">Power</span>
<span style="color:#aaa;font-weight:bold;">${powerStr}</span> <span style="color:#aaa;font-weight:bold;">${powerStr}</span>
</div>`; </div>` +
`<canvas id="vv-gpu-canvas" style="width:100%;height:60px;display:block;"></canvas>`;
vvGpuHistory.push(utilPct);
if (vvGpuHistory.length > VV_HIST_MAX) vvGpuHistory.shift();
vvDrawChart(document.getElementById('vv-gpu-canvas'), vvGpuHistory, '#7e57c2', 'rgba(126,87,194,0.18)', true);
} else { } else {
document.getElementById('vv-gpu-body').innerHTML = '<p style="color:#555;font-style:italic">No GPU detected</p>'; document.getElementById('vv-gpu-body').innerHTML = '<p style="color:#555;font-style:italic">No GPU detected</p>';
} }