Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Distinguish Unraid issue and protection columns on the storage page

rcourtman2f771baf3de2
diff --git a/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.test.ts
index a0817119cb..8238c859c2 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.test.ts
@@ -8,6 +8,7 @@ import {
getResourceStorageIssueSummary,
getResourceStoragePlatformLabel,
getResourceStorageProtectionLabel,
+ getResourceStorageProtectionSummary,
getResourceStorageTopologyLabel,
} from '@/features/storageBackups/resourceStoragePresentation';
@@ -170,6 +171,104 @@ describe('resourceStoragePresentation', () => {
);
});
+ it('produces short Unraid protection labels and matching summaries when a parity check is running', () => {
+ const resource = makeResource({
+ type: 'storage',
+ name: 'Tower Array',
+ status: 'warning',
+ storage: {
+ protection: 'none',
+ protectionReduced: true,
+ protectionSummary: 'Unraid array is running without parity protection',
+ rebuildInProgress: true,
+ rebuildSummary: 'Unraid array is running check',
+ riskSummary: 'Unraid array is running without parity protection',
+ arrayState: 'STARTED',
+ syncAction: 'check',
+ syncProgress: 0,
+ risk: {
+ level: 'warning',
+ reasons: [
+ {
+ code: 'unraid_no_parity',
+ severity: 'warning',
+ summary: 'Unraid array is running without parity protection',
+ },
+ {
+ code: 'unraid_sync_active',
+ severity: 'warning',
+ summary: 'Unraid array is running check',
+ },
+ ],
+ },
+ },
+ });
+
+ expect(getResourceStorageProtectionLabel(resource)).toBe('Parity check');
+ expect(getResourceStorageProtectionSummary(resource)).toBe('Unraid array is running check');
+ expect(getResourceStorageIssueLabel(resource)).toBe('No parity protection');
+ expect(getResourceStorageIssueSummary(resource)).toBe(
+ 'Unraid array is running without parity protection',
+ );
+ });
+
+ it('marks an Unraid array without parity as Unprotected when no rebuild is running', () => {
+ const resource = makeResource({
+ type: 'storage',
+ name: 'Tower Array',
+ status: 'warning',
+ storage: {
+ protection: 'none',
+ protectionReduced: true,
+ protectionSummary: 'Unraid array is running without parity protection',
+ rebuildInProgress: false,
+ riskSummary: 'Unraid array is running without parity protection',
+ arrayState: 'STARTED',
+ risk: {
+ level: 'warning',
+ reasons: [
+ {
+ code: 'unraid_no_parity',
+ severity: 'warning',
+ summary: 'Unraid array is running without parity protection',
+ },
+ ],
+ },
+ },
+ });
+
+ expect(getResourceStorageProtectionLabel(resource)).toBe('Unprotected');
+ expect(getResourceStorageIssueLabel(resource)).toBe('No parity protection');
+ });
+
+ it('appends sync progress to Unraid parity-rebuild labels when known', () => {
+ const resource = makeResource({
+ type: 'storage',
+ name: 'Tower Array',
+ status: 'warning',
+ storage: {
+ protectionReduced: false,
+ rebuildInProgress: true,
+ rebuildSummary: 'Unraid array is running recon (47%)',
+ arrayState: 'STARTED',
+ syncAction: 'recon',
+ syncProgress: 47,
+ risk: {
+ level: 'warning',
+ reasons: [
+ {
+ code: 'unraid_sync_active',
+ severity: 'warning',
+ summary: 'Unraid array is running recon (47%)',
+ },
+ ],
+ },
+ },
+ });
+
+ expect(getResourceStorageProtectionLabel(resource)).toBe('Parity rebuild (47%)');
+ });
+
it('keeps VMware datastore protection copy neutral on the shared storage path', () => {
const resource = makeResource({
platformType: 'vmware-vsphere',
diff --git a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
index c16b802cc3..3fb2715828 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
@@ -60,7 +60,8 @@ describe('storage row presentation', () => {
...baseRecord(),
issueLabel: 'Protection Reduced',
issueSummary: 'Parity lost on array',
- protectionLabel: 'Healthy',
+ protectionLabel: 'Unprotected',
+ protectionSummary: 'Parity lost on array',
protectionReduced: true,
incidentSeverity: 'critical',
};
@@ -69,6 +70,22 @@ describe('storage row presentation', () => {
expect(getCompactStoragePoolProtectionTitle(record)).toBe('Parity lost on array');
});
+ it('keeps protection title aligned with cell label and never reuses a mismatched issue summary', () => {
+ const record = {
+ ...baseRecord(),
+ issueLabel: 'No parity protection',
+ issueSummary: 'Unraid array is running without parity protection',
+ protectionLabel: 'Parity check',
+ protectionSummary: 'Unraid array is running check',
+ protectionReduced: true,
+ rebuildInProgress: true,
+ incidentSeverity: 'warning',
+ };
+ expect(getCompactStoragePoolProtectionLabel(record)).toBe('Parity check');
+ expect(getCompactStoragePoolProtectionTitle(record)).toBe('Unraid array is running check');
+ expect(getCompactStoragePoolProtectionTitle(record)).not.toContain('without parity');
+ });
+
it('derives zfs issue fallback from pool state and errors', () => {
const record = {
...baseRecord(),
diff --git a/frontend-modern/src/features/storageBackups/models.ts b/frontend-modern/src/features/storageBackups/models.ts
index 671b22fc94..744c6e2768 100644
--- a/frontend-modern/src/features/storageBackups/models.ts
+++ b/frontend-modern/src/features/storageBackups/models.ts
@@ -73,6 +73,7 @@ export interface StorageRecord {
platformKey?: StorageBackupPlatform;
topologyLabel?: string;
protectionLabel?: string;
+ protectionSummary?: string;
protectionReduced?: boolean;
rebuildInProgress?: boolean;
incidentCategory?: string;
diff --git a/frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts b/frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts
index 3a471ae354..933ffef6fe 100644
--- a/frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts
+++ b/frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts
@@ -3,9 +3,11 @@ import { getSourcePlatformLabel, normalizeSourcePlatformKey } from '@/utils/sour
import type { StorageBackupPlatform } from './models';
import { isBackupRepositoryStorageResource } from './resourceStorageMapping';
+type StorageRiskReasonLike = { code?: string; summary?: string };
+
type StorageRiskLike = {
level?: string;
- reasons?: { summary?: string }[];
+ reasons?: StorageRiskReasonLike[];
};
const titleize = (value: string | undefined | null): string =>
@@ -27,6 +29,114 @@ const getResourceStorageRiskIssue = (resource: Resource): string =>
firstRiskReasonSummary(resource.storage?.risk) ||
firstRiskReasonSummary(resource.pbs?.storageRisk);
+const collectRiskReasons = (resource: Resource): StorageRiskReasonLike[] => {
+ const out: StorageRiskReasonLike[] = [];
+ for (const reason of resource.storage?.risk?.reasons || []) {
+ if (reason) out.push(reason);
+ }
+ for (const reason of resource.pbs?.storageRisk?.reasons || []) {
+ if (reason) out.push(reason);
+ }
+ return out;
+};
+
+const findRiskReason = (
+ resource: Resource,
+ codes: string[],
+): StorageRiskReasonLike | undefined => {
+ const wanted = new Set(codes.map((code) => code.toLowerCase()));
+ for (const reason of collectRiskReasons(resource)) {
+ const code = (reason.code || '').toLowerCase();
+ if (wanted.has(code)) return reason;
+ }
+ return undefined;
+};
+
+const isUnraidStorageResource = (resource: Resource): boolean => {
+ const storage = resource.storage;
+ if (!storage) return false;
+ if (storage.arrayState || storage.syncAction) return true;
+ for (const reason of storage.risk?.reasons || []) {
+ if ((reason.code || '').toLowerCase().startsWith('unraid_')) return true;
+ }
+ return false;
+};
+
+const unraidShortSyncLabel = (
+ syncAction: string | undefined,
+ syncProgress?: number,
+): string => {
+ const action = (syncAction || '').trim().toLowerCase();
+ let base: string;
+ switch (action) {
+ case 'check':
+ base = 'Parity check';
+ break;
+ case 'recon':
+ case 'recon-p':
+ case 'rebuild':
+ base = 'Parity rebuild';
+ break;
+ case 'sync':
+ base = 'Parity sync';
+ break;
+ case 'clear':
+ base = 'Clearing';
+ break;
+ case '':
+ base = 'Rebuilding';
+ break;
+ default:
+ base = titleize(action);
+ break;
+ }
+ if (typeof syncProgress === 'number' && Number.isFinite(syncProgress) && syncProgress > 0) {
+ return `${base} (${Math.round(syncProgress)}%)`;
+ }
+ return base;
+};
+
+const getUnraidShortProtectionLabel = (resource: Resource): string => {
+ const storage = resource.storage;
+ if (!storage) return '';
+ if (storage.rebuildInProgress) {
+ return unraidShortSyncLabel(storage.syncAction, storage.syncProgress);
+ }
+ if (storage.protectionReduced) {
+ if ((storage.protection || '').trim().toLowerCase() === 'none') {
+ return 'Unprotected';
+ }
+ if (findRiskReason(resource, ['unraid_no_parity'])) return 'Unprotected';
+ if (findRiskReason(resource, ['unraid_parity_unavailable'])) return 'Parity unavailable';
+ return 'Protection reduced';
+ }
+ return '';
+};
+
+const getUnraidShortIssueLabel = (resource: Resource): string => {
+ const reasons = collectRiskReasons(resource);
+ if (reasons.length === 0) return '';
+ for (const reason of reasons) {
+ const code = (reason.code || '').toLowerCase();
+ switch (code) {
+ case 'unraid_parity_unavailable':
+ return 'Parity unavailable';
+ case 'unraid_no_parity':
+ return 'No parity protection';
+ case 'unraid_invalid_disks':
+ case 'unraid_disabled_disks':
+ case 'unraid_missing_disks':
+ return trimSummary(reason.summary).replace(/^Unraid array reports\s+/i, '') || 'Disk issue';
+ case 'unraid_sync_active':
+ return unraidShortSyncLabel(
+ resource.storage?.syncAction,
+ resource.storage?.syncProgress,
+ );
+ }
+ }
+ return '';
+};
+
const isAttentionStatus = (value: string | undefined): boolean => {
const normalized = (value || '').trim().toLowerCase();
if (!normalized) return false;
@@ -142,6 +252,10 @@ export const getResourceStorageTopologyLabel = (
export const getResourceStorageIssueLabel = (resource: Resource): string => {
if (resource.incidentLabel?.trim()) return resource.incidentLabel.trim();
+ if (isUnraidStorageResource(resource)) {
+ const unraidLabel = getUnraidShortIssueLabel(resource);
+ if (unraidLabel) return unraidLabel;
+ }
const riskIssue = getResourceStorageRiskIssue(resource);
if (riskIssue) return riskIssue;
const postureIssue = getCompositePostureIssue(resource);
@@ -181,6 +295,10 @@ export const getResourceStorageActionSummary = (resource: Resource): string => {
};
export const getResourceStorageProtectionLabel = (resource: Resource): string => {
+ if (isUnraidStorageResource(resource)) {
+ const unraidLabel = getUnraidShortProtectionLabel(resource);
+ if (unraidLabel) return unraidLabel;
+ }
if (resource.storage?.rebuildInProgress) {
return resource.storage.rebuildSummary || 'Rebuild In Progress';
}
@@ -211,3 +329,16 @@ export const getResourceStorageProtectionLabel = (resource: Resource): string =>
}
return 'Healthy';
};
+
+export const getResourceStorageProtectionSummary = (resource: Resource): string => {
+ if (resource.storage?.rebuildInProgress) {
+ return trimSummary(resource.storage.rebuildSummary);
+ }
+ if (resource.storage?.protectionReduced) {
+ return trimSummary(resource.storage.protectionSummary);
+ }
+ if (resource.incidentCategory === 'recoverability') {
+ return trimSummary(resource.incidentSummary);
+ }
+ return '';
+};
diff --git a/frontend-modern/src/features/storageBackups/rowPresentation.ts b/frontend-modern/src/features/storageBackups/rowPresentation.ts
index 0dd6858a76..122dff00e3 100644
--- a/frontend-modern/src/features/storageBackups/rowPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/rowPresentation.ts
@@ -36,9 +36,15 @@ export function getCompactStoragePoolProtectionLabel(record: StorageRecord): str
export function getCompactStoragePoolProtectionTitle(record: StorageRecord): string {
const label = getCompactStoragePoolProtectionLabel(record);
if (label === '—') return '';
- const summary = getStorageRecordIssueSummary(record).trim();
- if (summary && summary.toLowerCase() !== 'healthy') {
- return summary;
+ const protectionSummary = (record.protectionSummary || '').trim();
+ if (protectionSummary && protectionSummary.toLowerCase() !== label.toLowerCase()) {
+ return protectionSummary;
+ }
+ if (record.protectionReduced || record.rebuildInProgress) {
+ const issueSummary = getStorageRecordIssueSummary(record).trim();
+ if (issueSummary && issueSummary.toLowerCase() !== 'healthy') {
+ return issueSummary;
+ }
}
return label;
}
diff --git a/frontend-modern/src/features/storageBackups/storageAdapters.ts b/frontend-modern/src/features/storageBackups/storageAdapters.ts
index b3bde80c01..bb9320d421 100644
--- a/frontend-modern/src/features/storageBackups/storageAdapters.ts
+++ b/frontend-modern/src/features/storageBackups/storageAdapters.ts
@@ -12,6 +12,7 @@ import {
getResourceStorageIssueSummary,
getResourceStoragePlatformLabel,
getResourceStorageProtectionLabel,
+ getResourceStorageProtectionSummary,
getResourceStorageTopologyLabel,
} from './resourceStoragePresentation';
import {
@@ -120,6 +121,7 @@ const mapResourceStorageRecord = (resource: Resource, adapterId: string): Storag
const impactSummary = getResourceStorageImpactSummary(resource);
const actionSummary = getResourceStorageActionSummary(resource);
const protectionLabel = getResourceStorageProtectionLabel(resource);
+ const protectionSummary = getResourceStorageProtectionSummary(resource);
const topologyLabel = getResourceStorageTopologyLabel(
resource,
storageType,
@@ -140,6 +142,7 @@ const mapResourceStorageRecord = (resource: Resource, adapterId: string): Storag
platformKey: canonicalPlatform,
topologyLabel,
protectionLabel,
+ protectionSummary,
protectionReduced: resource.storage?.protectionReduced,
rebuildInProgress: resource.storage?.rebuildInProgress,
incidentCategory: resource.incidentCategory,
@@ -233,6 +236,10 @@ const mergeStorageRecords = (current: StorageRecord, incoming: StorageRecord): S
preferred.protectionReduced || preferred.rebuildInProgress || preferred.incidentPriority
? preferred.protectionLabel || secondary.protectionLabel
: secondary.protectionLabel || preferred.protectionLabel,
+ protectionSummary:
+ preferred.protectionReduced || preferred.rebuildInProgress || preferred.incidentPriority
+ ? preferred.protectionSummary || secondary.protectionSummary
+ : secondary.protectionSummary || preferred.protectionSummary,
protectionReduced: preferred.protectionReduced || secondary.protectionReduced,
rebuildInProgress: preferred.rebuildInProgress || secondary.rebuildInProgress,
issueLabel: