fix(gui): "CPU-Temperatur" statt Zonenname in Klammern

Die Zeile zeigt nur noch den Wert in Grad. Damit die neue Beschriftung
stimmt, filtert sysstat.js die Zonen enger: nur soc-thermal, bigcore0/1
und littlecore. GPU-, NPU- und Center-Zone konnten vorher den Hoechstwert
stellen, obwohl "CPU" daran steht.

Doku: Kapitel 07 + Changelog.
This commit is contained in:
Claude
2026-08-17 22:29:02 +02:00
parent 6973b46d75
commit c562586216
4 changed files with 20 additions and 8 deletions
+5 -3
View File
@@ -34,8 +34,10 @@ sampleCpu();
setInterval(sampleCpu, 2000).unref();
// ---- Temperatur ---------------------------------------------------------
// Interessant sind die SoC-/Kern-Zonen; WLAN-Karte & Co. bleiben draußen, sonst
// zeigt die Anzeige eine Temperatur, die nichts mit der Rechenlast zu tun hat.
// Gemeldet wird die CPU-Temperatur: wärmste der Kern-Zonen (bigcore0/1,
// littlecore) plus soc-thermal. GPU, NPU und die WLAN-Karte bleiben draußen —
// die GUI beschriftet den Wert als „CPU-Temperatur“, also darf auch nur CPU
// drinstecken.
const TEMP_ZONES = (() => {
try {
return fs.readdirSync('/sys/class/thermal')
@@ -46,7 +48,7 @@ const TEMP_ZONES = (() => {
try { type = fs.readFileSync(`${dir}/type`, 'utf8').trim(); } catch { }
return { type, file: `${dir}/temp` };
})
.filter(z => /soc|core|center|npu|gpu/i.test(z.type));
.filter(z => /^(soc|bigcore\d*|littlecore)-thermal$/i.test(z.type));
} catch { return []; }
})();
+2 -2
View File
@@ -118,7 +118,7 @@ function sysmonMarkup() {
<div class="sys-bar"><i data-cpu-bar style="width:0%"></i></div>
<div class="sys-row"><span>RAM</span><b data-ram-pct>–</b></div>
<div class="sys-bar"><i data-ram-bar style="width:0%"></i></div>
<div class="sys-row"><span>Temperatur</span><b data-temp>–</b></div>
<div class="sys-row"><span>CPU-Temperatur</span><b data-temp>–</b></div>
</div>
</div>
</div>`;
@@ -171,7 +171,7 @@ function paintSysmon(s) {
load.title = `CPU ${Math.round(cpu)} % · RAM ${Math.round(ram)} %${tc == null ? '' : ` · ${tc.toFixed(0)} °C`}`;
set('[data-cpu-pct]', `${cpu.toFixed(0)} %${s.cpu && s.cpu.cores ? ` (${s.cpu.cores} Kerne)` : ''}`);
set('[data-ram-pct]', s.ram ? `${ram.toFixed(0)} % — ${sysGb(s.ram.usedBytes)} von ${sysGb(s.ram.totalBytes)}` : '–');
set('[data-temp]', tc == null ? '–' : `${tc.toFixed(1)} °C${s.temp.zone ? ` (${s.temp.zone})` : ''}`);
set('[data-temp]', tc == null ? '–' : `${tc.toFixed(1)} °C`);
const cb = document.querySelector('[data-cpu-bar]'); if (cb) cb.style.width = Math.min(100, cpu) + '%';
const rb = document.querySelector('[data-ram-bar]'); if (rb) rb.style.width = Math.min(100, ram) + '%';
const tb = document.querySelector('[data-turbine]');