Fix dashboard storage pool label styling
All checks were successful
Build and Release / build-and-release (push) Successful in 1m20s

Replace non-existent Typography::primary() with Typography::secondary() for
MergerFS pool labels following existing UI patterns.
This commit is contained in:
2025-11-25 10:16:26 +01:00
parent 7a95a9d762
commit 8f80015273
7 changed files with 123 additions and 26 deletions

View File

@@ -273,6 +273,17 @@ impl SystemWidget {
// Convert pools (MergerFS, RAID, etc.)
for pool in &agent_data.system.storage.pools {
// Use agent-calculated status (combined health and usage status)
let pool_status = if pool.health_status == Status::Critical || pool.usage_status == Status::Critical {
Status::Critical
} else if pool.health_status == Status::Warning || pool.usage_status == Status::Warning {
Status::Warning
} else if pool.health_status == Status::Ok && pool.usage_status == Status::Ok {
Status::Ok
} else {
Status::Unknown
};
let mut storage_pool = StoragePool {
name: pool.name.clone(),
mount_point: pool.mount.clone(),
@@ -284,27 +295,49 @@ impl SystemWidget {
usage_percent: Some(pool.usage_percent),
used_gb: Some(pool.used_gb),
total_gb: Some(pool.total_gb),
status: Status::Ok, // TODO: map pool health to status
status: pool_status,
};
// Add data drives
// Add data drives - use agent-calculated status
for drive in &pool.data_drives {
// Use combined health and temperature status
let drive_status = if drive.health_status == Status::Critical || drive.temperature_status == Status::Critical {
Status::Critical
} else if drive.health_status == Status::Warning || drive.temperature_status == Status::Warning {
Status::Warning
} else if drive.health_status == Status::Ok && drive.temperature_status == Status::Ok {
Status::Ok
} else {
Status::Unknown
};
let storage_drive = StorageDrive {
name: drive.name.clone(),
temperature: drive.temperature_celsius,
wear_percent: drive.wear_percent,
status: Status::Ok, // TODO: map drive health to status
status: drive_status,
};
storage_pool.data_drives.push(storage_drive);
}
// Add parity drives
// Add parity drives - use agent-calculated status
for drive in &pool.parity_drives {
// Use combined health and temperature status
let drive_status = if drive.health_status == Status::Critical || drive.temperature_status == Status::Critical {
Status::Critical
} else if drive.health_status == Status::Warning || drive.temperature_status == Status::Warning {
Status::Warning
} else if drive.health_status == Status::Ok && drive.temperature_status == Status::Ok {
Status::Ok
} else {
Status::Unknown
};
let storage_drive = StorageDrive {
name: drive.name.clone(),
temperature: drive.temperature_celsius,
wear_percent: drive.wear_percent,
status: Status::Ok, // TODO: map drive health to status
status: drive_status,
};
storage_pool.parity_drives.push(storage_drive);
}
@@ -403,7 +436,8 @@ impl SystemWidget {
// Data Disks section
if !pool.data_drives.is_empty() {
lines.push(Line::from(vec![
Span::styled(" ├─ Data Disks:", Typography::secondary())
Span::styled(" ├─ ", Typography::tree()),
Span::styled("Data Disks:", Typography::secondary())
]));
for (i, drive) in pool.data_drives.iter().enumerate() {
let is_last = i == pool.data_drives.len() - 1;
@@ -414,7 +448,6 @@ impl SystemWidget {
// Parity section
if !pool.parity_drives.is_empty() {
let parity_symbol = " ├─ Parity: ";
for drive in &pool.parity_drives {
let mut drive_details = Vec::new();
if let Some(temp) = drive.temperature {
@@ -431,7 +464,8 @@ impl SystemWidget {
};
let mut parity_spans = vec![
Span::styled(parity_symbol, Typography::tree()),
Span::styled(" ├─ ", Typography::tree()),
Span::styled("Parity: ", Typography::secondary()),
];
parity_spans.extend(StatusIcons::create_status_spans(drive.status.clone(), &drive_text));
lines.push(Line::from(parity_spans));