From cfc473477a60919a556bbb02d9faf60591592bfd Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:25:50 +0000 Subject: [PATCH] fix(mover): allow empty action without pools - Purpose: backport the no-pool mover empty fix to the 7.2 branch.\n- Before: the UI disabled or hid mover controls when no cache/pool devices existed, even though the empty-array-disk action can still run without a pool assignment.\n- Why: users could not invoke mover to empty an array disk on systems with no configured pool.\n- What: keep mover controls available for the empty action when user shares are enabled and no pool devices exist.\n- How: update the scheduler button text/state and add matching Array Operation button handling for no-pool systems while preserving disabled states during parity, mover, and BTRFS operations.\n- Source: cherry-picked from fd5251ad4fab628c5ea0800642d6b312da25ade9. --- emhttp/plugins/dynamix/ArrayOperation.page | 23 ++++++++++++++++++++++ emhttp/plugins/dynamix/MoverSettings.page | 12 ++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/emhttp/plugins/dynamix/ArrayOperation.page b/emhttp/plugins/dynamix/ArrayOperation.page index 74381e295b..f08dc3c605 100644 --- a/emhttp/plugins/dynamix/ArrayOperation.page +++ b/emhttp/plugins/dynamix/ArrayOperation.page @@ -394,6 +394,10 @@ mymonitor.on('message', function(state) { $('#mover-button').prop('disabled',false); $('#mover-text').html("_(Move)_ _(will immediately invoke the Mover)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); + + + $('#mover-button').prop('disabled',false); + $('#mover-text').html("_(Empty)_ _(will immediately invoke the Mover to Empty a disk)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); break; case '1': // parity running @@ -406,6 +410,10 @@ mymonitor.on('message', function(state) { $('#mover-button').prop('disabled',true); $('#mover-text').html("_(Disabled)_ -- _(Parity operation is running)_"); + + + $('#mover-button').prop('disabled',true); + $('#mover-text').html("_(Empty)_ _(will immediately invoke the Mover to Empty a disk)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); break; case '2': // mover running @@ -414,6 +422,10 @@ mymonitor.on('message', function(state) { $('#mover-button').prop('disabled',true); $('#mover-text').html("_(Disabled)_ - _(Mover is running)_."); + + + $('#mover-button').prop('disabled',true); + $('#mover-text').html("_(Empty)_ _(will immediately invoke the Mover to Empty a disk)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); break; case '3': // btrfs running @@ -422,6 +434,10 @@ mymonitor.on('message', function(state) { $('#mover-button').prop('disabled',true); $('#mover-text').html("_(Disabled)_ -- _(BTRFS operation is running)_"); + + + $('#mover-button').prop('disabled',true); + $('#mover-text').html("_(Empty)_ _(will immediately invoke the Mover to Empty a disk)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); break; } @@ -832,6 +848,13 @@ endswitch; + +
+ + +
+
+
diff --git a/emhttp/plugins/dynamix/MoverSettings.page b/emhttp/plugins/dynamix/MoverSettings.page index e6576111a4..e67f46f949 100755 --- a/emhttp/plugins/dynamix/MoverSettings.page +++ b/emhttp/plugins/dynamix/MoverSettings.page @@ -18,13 +18,15 @@ Tag="calendar-check-o" $mode = ['Disabled','Hourly','Daily','Weekly','Monthly']; $days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; $setup = true; +$buttontext = _('Move now'); if (!$pool_devices) { - echo "

"._('No Cache device present')."!

"; - $setup = false; + echo "

"._('No Cache device present only empty function will run')."!

"; + $setup = true; + $buttontext = _('Empty now'); } elseif ($var['shareUser']=='-') { echo "

"._('User shares not enabled')."!

"; $setup = false; -} +} if (empty($var['shareMoverSchedule'])) { $cron = explode(' ', "* * * * *"); $move = 0; @@ -32,7 +34,7 @@ if (empty($var['shareMoverSchedule'])) { $cron = explode(' ', $var['shareMoverSchedule']); $move = $cron[2]!='*' ? 4 : ($cron[4]!='*' ? 3 : (substr($cron[1],0,1)!='*' ? 2 : 1)); } -$showMoverButton = $setup && $pool_devices; +$showMoverButton = $setup; $moverRunning = file_exists('/var/run/mover.pid'); ?>