diff --git a/Plugin/unraid/include/common.php b/Plugin/unraid/include/common.php index 4afbb03..546fe3a 100644 --- a/Plugin/unraid/include/common.php +++ b/Plugin/unraid/include/common.php @@ -410,10 +410,11 @@ function vv_parity_status(): array { // Emulated (DISK_DSBL) disks are protected by parity and don't make parity invalid. // True invalidity: sync errors on the last check, or unprotectable missing slots. $isValid = $errors === 0 && $numMissing === 0; - $inProgress = ($var['mdResync'] ?? '0') !== '0'; - $resyncPos = (int)($var['mdResyncPos'] ?? 0); - $resyncSize = (int)($var['mdResyncSize'] ?? 1); - $resyncPct = $resyncSize > 0 ? round($resyncPos / $resyncSize * 100, 1) : 0; + $inProgress = ($var['mdResync'] ?? '0') !== '0'; + $resyncAction = trim($var['mdResyncAction'] ?? ''); + $resyncPos = (int)($var['mdResyncPos'] ?? 0); + $resyncSize = (int)($var['mdResyncSize'] ?? 1); + $resyncPct = $resyncSize > 0 ? round($resyncPos / $resyncSize * 100, 1) : 0; // Last check from log $lastDate = null; $lastDuration = 0; $lastSpeed = 0; $lastErrors = 0; $lastExit = 0; @@ -457,8 +458,9 @@ function vv_parity_status(): array { 'valid' => $isValid, 'num_disabled' => $numDisabled, 'num_missing' => $numMissing, - 'in_progress' => $inProgress, - 'resync_pct' => $resyncPct, + 'in_progress' => $inProgress, + 'resync_action' => $resyncAction, + 'resync_pct' => $resyncPct, 'exit_code' => $exitCode, 'exit_label' => $exitMap[(string)$lastExit] ?? 'Unknown', 'errors' => $lastErrors, diff --git a/Plugin/unraid/pages/monitor.php b/Plugin/unraid/pages/monitor.php index a3702bd..6adcd55 100644 --- a/Plugin/unraid/pages/monitor.php +++ b/Plugin/unraid/pages/monitor.php @@ -1046,8 +1046,23 @@ function vvPollMonitor() { `; if (inProg) { - const pct = par.resync_pct ?? 0; - html += `
Check in progress — ${pct}%
+ const pct = par.resync_pct ?? 0; + const action = par.resync_action ?? ''; + let opLabel; + if (/^recon/i.test(action)) { + const disk = action.replace(/^recon\s*/i, '').trim(); + opLabel = 'Rebuilding' + (disk ? ' disk ' + disk : ''); + } else if (/^check/i.test(action)) { + opLabel = 'Parity check'; + } else if (/^sync/i.test(action)) { + opLabel = 'Parity sync'; + } else if (/^clear/i.test(action)) { + const disk = action.replace(/^clear\s*/i, '').trim(); + opLabel = 'Clearing' + (disk ? ' disk ' + disk : ''); + } else { + opLabel = action || 'Operation'; + } + html += `
${opLabel} — ${pct}%
`;