Parity card: show correct operation label (rebuild vs check vs sync) from mdResyncAction
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user