Show total current PSU power and rely on server voltage status
This commit is contained in:
@@ -805,12 +805,23 @@ function renderConfig(data) {
|
||||
const psuOK = powerSupplies.filter(p => p.status === 'OK').length;
|
||||
const psuModel = powerSupplies[0].model || '-';
|
||||
const psuWattage = powerSupplies[0].wattage_w || 0;
|
||||
const psuCurrentPowerW = powerSupplies.reduce((sum, psu) => {
|
||||
if (Number.isFinite(psu.output_power_w) && psu.output_power_w > 0) {
|
||||
return sum + psu.output_power_w;
|
||||
}
|
||||
if (Number.isFinite(psu.input_power_w) && psu.input_power_w > 0) {
|
||||
return sum + psu.input_power_w;
|
||||
}
|
||||
return sum;
|
||||
}, 0);
|
||||
const psuCurrentPowerLabel = psuCurrentPowerW > 0 ? `${psuCurrentPowerW}W` : '-';
|
||||
html += `<h3>Блоки питания</h3>
|
||||
<div class="section-overview">
|
||||
<div class="stat-box"><span class="stat-value">${psuTotal}</span><span class="stat-label">Всего</span></div>
|
||||
<div class="stat-box"><span class="stat-value">${psuPresent}</span><span class="stat-label">Подключено</span></div>
|
||||
<div class="stat-box"><span class="stat-value">${psuOK}</span><span class="stat-label">Работает</span></div>
|
||||
<div class="stat-box"><span class="stat-value">${psuWattage}W</span><span class="stat-label">Мощность</span></div>
|
||||
<div class="stat-box"><span class="stat-value">${psuCurrentPowerLabel}</span><span class="stat-label">Текущая суммарная</span></div>
|
||||
<div class="stat-box model-box"><span class="stat-value">${escapeHtml(psuModel)}</span><span class="stat-label">Модель</span></div>
|
||||
</div>
|
||||
<table class="config-table"><thead><tr><th>Слот</th><th>Производитель</th><th>Модель</th><th>Мощность</th><th>Вход</th><th>Выход</th><th>Напряжение</th><th>Температура</th><th>Статус</th></tr></thead><tbody>`;
|
||||
@@ -1111,9 +1122,9 @@ function renderSensors(sensors) {
|
||||
valueStr = s.status;
|
||||
}
|
||||
|
||||
// Highlight PSU mains voltage deviations from nominal 230V (±10%).
|
||||
// Server computes PSU voltage range status; UI only reflects it.
|
||||
let extraClass = '';
|
||||
if (isPSUVoltage && Number.isFinite(s.value) && (s.value < 207 || s.value > 253)) {
|
||||
if (isPSUVoltage && s.status === 'warn') {
|
||||
extraClass = ' voltage-out-of-range';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user