diff --git a/README.md b/README.md index c17ed31..292e686 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Configuration is done through a user-friendly interface, with custom thresholds, - Lays the fan configurations out side by side, wrapping to the next row, so a wide screen shows several at once and a phone shows one - Dashboard tile and system integration - Optional FCP Airflow Dashboard tile, similar to Unraid’s built-in Airflow tile but enhanced with support for custom fan labels +- Optionally shows each fan's speed and PWM percentage in the status bar at the bottom of every Unraid page. Dynamix System Temperature shows the percentage only with Dynamix Auto Fan, which should not run alongside FanCtrlPlus. Turn it on per fan under Syslog & Alerts - Reorder fan configurations with a button per direction, on a desktop or a phone. The new order is saved and reflected in both the UI and Dashboard. --- diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php b/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php index 20e8c42..5ffab32 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/Fanctrl2Dashboard.php @@ -19,7 +19,13 @@ exit; } -foreach (glob("$cfg_path/{$plugin}_*.cfg") as $file) { +// The settings page's order, so the footer lists fans the same way. +require_once __DIR__.'/include/OrderManager.php'; +$rank = array_flip(OrderManager::readOrder()); +$files = glob("$cfg_path/{$plugin}_*.cfg") ?: []; +usort($files, fn($a, $b) => ($rank[basename($a)] ?? PHP_INT_MAX) <=> ($rank[basename($b)] ?? PHP_INT_MAX)); + +foreach ($files as $file) { $cfg = parse_ini_file($file); $custom = $cfg['custom'] ?? basename($file, '.cfg'); $label = $custom; @@ -64,7 +70,8 @@ 'temp_origin' => $temp_origin, 'rpm_val' => $rpm_val, 'percent' => $pct_val, - 'status' => $status + 'status' => $status, + 'footer' => ($cfg['footer'] ?? '0') !== '0' ]; } diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2Footer.page b/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2Footer.page new file mode 100644 index 0000000..3bfd14f --- /dev/null +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/FanctrlPlus2Footer.page @@ -0,0 +1,46 @@ +Menu="Buttons" +Link="nav-user" +--- + + + + diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css b/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css index 3af7fa1..a92eb10 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css @@ -568,7 +568,7 @@ dt.containerSettingsDt { .fcp-airflow-switch{ display: none; } .fcp-history-switch{ display: none; } -.syslog-switch, .notify-switch{ display: none; } +.syslog-switch, .notify-switch, .footer-switch{ display: none; } .switch-button-label{ font-size: 12px; } .switch-button-label.on{ display: none; } .switch-button-background.checked ~ .switch-button-label.on{ display: inline; } diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page b/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page index 9d6b0f3..a42fbc0 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page @@ -1282,8 +1282,9 @@ $(function() { $area.find('.switch-button-button').css('left', checked ? '12px' : '-1px'); // Persist the relevant switch. - if ($input.hasClass('syslog-switch') || $input.hasClass('notify-switch')) { - saveFanSwitchState($input.hasClass('syslog-switch') ? 'setsyslog' : 'setnotify', $input.data('cfg'), checked); + var fanKey = ['syslog', 'notify', 'footer'].find(function(k) { return $input.hasClass(k + '-switch'); }); + if (fanKey) { + saveFanSwitchState('set' + fanKey, $input.data('cfg'), checked); } else if ($input.hasClass('fcp-airflow-switch')) { saveAirflowSwitchState(checked); } else if ($input.hasClass('fcp-history-switch')) { @@ -1292,7 +1293,7 @@ $(function() { }); // Shared change handler for the per-fan and FCP Airflow/History switches. - $(document).on('change', '.syslog-switch, .notify-switch, .fcp-airflow-switch, .fcp-history-switch', function() { + $(document).on('change', '.syslog-switch, .notify-switch, .footer-switch, .fcp-airflow-switch, .fcp-history-switch', function() { var checked = $(this).prop('checked'); var $area = $(this).closest('.switch-area'); @@ -1841,7 +1842,7 @@ $(function() {
Identify PWM Controller: Use this tool to help locate which physical fan is linked to each PWM controller. After identification, adding a custom label makes it easier to recognize and configure later.
-Syslog & Alerts: Enable or disable syslog logging for each fan individually. When enabled, changes in temperature and fan speed will be recorded in the system log. If a fan setup is already stable or updates too frequently, you can turn off its logging to reduce clutter. Problem alerts send Unraid notifications when a fan has a problem; turn them off for a fan whose controller raises false alarms.
+Syslog & Alerts: Enable or disable syslog logging for each fan individually. When enabled, changes in temperature and fan speed will be recorded in the system log. If a fan setup is already stable or updates too frequently, you can turn off its logging to reduce clutter. Problem alerts send Unraid notifications when a fan has a problem; turn them off for a fan whose controller raises false alarms. Footer shows the fan's speed and PWM percentage in the status bar at the bottom of every page; it is off by default.
Notes:
This helps you track fan behavior in real time. However, if a particular fan changes frequently and generates too many log entries, you can disable logging for that fan.
Note: The plugin only writes to syslog when the PWM value changes by more than 5 compared to the previous value — small changes are ignored to reduce log noise.
Problem Alerts are also enabled by default. Fan control keeps running either way; the alerts only send Unraid notifications. A fan gets one warning when, for at least 30 seconds, its PWM controller has disappeared, the BIOS or another program has taken it over, its controller reports a speed 10 or more percentage points away from the one set, or it reports 0 RPM while set above 40% after spinning earlier. A fan whose controller is missing when fan control starts, and a configured sensor without a reading for 60 seconds, also warn. Once the problem has stayed away for 30 seconds, a notice says so. Turn the alerts off for a fan whose controller raises false alarms, such as one with only a few speed steps.
+Footer is disabled by default. When on, the fan's speed and PWM percentage appear in the status bar at the bottom of every Unraid page, for example 1539 rpm (63%). Hover over a value to see the fan's name. A change shows from the next page load.
When RPM has changed in the requested direction at least 30 seconds after a substantial speed change, a PWM mismatch warning includes that observation. It suggests that the fan may have responded despite the reported PWM; it does not prove which controller changed the fan.
@@ -2087,6 +2089,7 @@ $(function() {