From a3783255a114721d88545f67a076b74a4ceda0d3 Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Tue, 6 Oct 2026 10:11:42 +0000 Subject: [PATCH 1/2] fanctrlplus2: one value per column in the dashboard widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The temperature cell packed the value and its source into fixed 30px and 55px grid tracks: "40 °C" ran into the source, and a long disk group name was cut mid-word and drawn over the RPM column on hover (#13). The widget now has one value per column, with units in the headers: Name, Temp (°C), Source, Speed (RPM), PWM (%), Status, Run. Cells clip with an ellipsis and never overflow, numbers are right-aligned, and names and sources carry their full text as a tooltip. On narrow screens the headers are abbreviated and each fan's source moves to a second line. The server sends the PWM percentage as a bare number, fan names are escaped, and the unused JSON field and mangled regexes are gone. --- .../fanctrlplus2/Fanctrl2Dashboard.php | 3 +- .../fanctrlplus2/FanctrlPlus2.Dashboard.page | 238 ++++++------------ 2 files changed, 83 insertions(+), 158 deletions(-) diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php b/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php index 7789d38..f07c9d1 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php @@ -60,11 +60,10 @@ $fans[] = [ 'label' => $label, - 'temp' => ($temp_val === "*" ? "*" : "{$temp_val}°C"), 'temp_raw' => $temp_val, 'temp_origin' => $temp_origin, 'rpm_val' => $rpm_val, - 'percent' => ($pct_val === "-" ? "-" : "{$pct_val} %"), + 'percent' => $pct_val, 'status' => $status ]; } diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2.Dashboard.page b/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2.Dashboard.page index 8b9393c..c59843c 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2.Dashboard.page +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2.Dashboard.page @@ -48,33 +48,26 @@ foreach ($cfg_files as $path) { // Build the HTML rows. $fan_rows = ""; foreach ($all_cfg as $cfg) { - $file = $cfg['file']; - $label = $cfg['custom'] ?? $file; - // Skip unnamed fans. if (empty($cfg['custom'])) continue; + $label = htmlspecialchars($cfg['custom'], ENT_QUOTES, 'UTF-8'); $fan_rows .= << - - $label - - -- - - - - -- - / - -- - - -- - + +
+ $label + -- + + -- + -- + -- + - +
ROW; } @@ -91,74 +84,43 @@ echo <<