mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 02:48:38 -04:00
controller: report cooling fan RPM in CPU status
The RPi 5 fan connector exposes a tachometer via the pwmfan hwmon device. Report it as fan_rpm in cpu_stats and show it in both the Controller fallback UI and the React Status page. Hidden when no fan is present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
f635671266
commit
42a017294e
6 changed files with 54 additions and 2 deletions
|
|
@ -938,7 +938,7 @@
|
|||
<div class="status-card">
|
||||
<h3>CPU</h3>
|
||||
<p class="value">{{ cpu.percent if cpu.percent is not none else '--' }}%</p>
|
||||
<p class="sub">{% if cpu.temperature_c %}{{ cpu.temperature_c }}°C{% else %}--{% endif %}</p>
|
||||
<p class="sub">{% if cpu.temperature_c %}{{ cpu.temperature_c }}°C{% else %}--{% endif %}{% if cpu.fan_rpm %} · {{ cpu.fan_rpm }} RPM{% endif %}</p>
|
||||
</div>
|
||||
<div class="status-card">
|
||||
<h3>Memory</h3>
|
||||
|
|
@ -2692,7 +2692,13 @@
|
|||
const cpuValue = document.querySelector('.status-card:nth-child(1) .value');
|
||||
const cpuSub = document.querySelector('.status-card:nth-child(1) .sub');
|
||||
if (cpuValue) cpuValue.textContent = (cpu.percent !== null ? cpu.percent : '--') + '%';
|
||||
if (cpuSub) cpuSub.innerHTML = cpu.temperature ? cpu.temperature + '°C' : '--';
|
||||
if (cpuSub) {
|
||||
let cpuSubText = cpu.temperature ? cpu.temperature + '°C' : '--';
|
||||
if (cpu.fan_rpm) {
|
||||
cpuSubText += ' · ' + cpu.fan_rpm + ' RPM';
|
||||
}
|
||||
cpuSub.innerHTML = cpuSubText;
|
||||
}
|
||||
|
||||
// Update Memory card
|
||||
const memValue = document.querySelector('.status-card:nth-child(2) .value');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue