Parity card: show correct operation label (rebuild vs check vs sync) from mdResyncAction
This commit is contained in:
@@ -1046,8 +1046,23 @@ function vvPollMonitor() {
|
||||
</div>`;
|
||||
|
||||
if (inProg) {
|
||||
const pct = par.resync_pct ?? 0;
|
||||
html += `<div style="font-size:11px;color:#aaa;margin-bottom:4px;">Check in progress — ${pct}%</div>
|
||||
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 += `<div style="font-size:11px;color:#aaa;margin-bottom:4px;">${opLabel} — ${pct}%</div>
|
||||
<div style="background:#1a1a1a;border-radius:3px;height:6px;overflow:hidden;margin-bottom:10px;">
|
||||
<div style="width:${pct}%;height:100%;background:#4caf50;border-radius:3px;transition:width 2s;"></div>
|
||||
</div>`;
|
||||
|
||||
Reference in New Issue
Block a user