Show archive count range to detect inconsistencies

- Display single number if all services have same count
- Display min-max range if counts differ (indicates problem)
This commit is contained in:
2025-11-29 17:59:24 +01:00
parent 1c1beddb55
commit 40f3ff66d8
4 changed files with 21 additions and 8 deletions

View File

@@ -142,12 +142,17 @@ impl BackupCollector {
// Build service list for this disk
let services: Vec<String> = backup_status.services.keys().cloned().collect();
// Get archive count per service (use minimum to show if any service has fewer backups)
let total_archives: i64 = backup_status.services.values()
// Get min and max archive counts to detect inconsistencies
let archives_min: i64 = backup_status.services.values()
.map(|service| service.archive_count)
.min()
.unwrap_or(0);
let archives_max: i64 = backup_status.services.values()
.map(|service| service.archive_count)
.max()
.unwrap_or(0);
// Create disk data
let disk_data = BackupDiskData {
serial: backup_status.disk_serial_number.unwrap_or_else(|| "Unknown".to_string()),
@@ -161,7 +166,8 @@ impl BackupCollector {
disk_total_gb: total_gb,
usage_status,
services,
total_archives,
archives_min,
archives_max,
};
disks.push(disk_data);