Restructure backup display to show per-repository metrics
All checks were successful
Build and Release / build-and-release (push) Successful in 1m15s

Remove disk-based backup display and implement repository-centric view
with per-repo archive counts and sizes. Backup now uses NFS storage
instead of direct disk monitoring.

Changes:
- Remove BackupDiskData, add BackupRepositoryData structure
- Display format: "Repo <timestamp>" with per-repo details
- Show archive count and size (MB/GB) for each repository
- Agent aggregates repo data from backup status TOML files
- Dashboard renders repo list with individual status indicators
This commit is contained in:
2025-12-09 19:22:51 +01:00
parent 407bc9dbc2
commit d922e8d6f3
7 changed files with 88 additions and 176 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard-shared"
version = "0.1.266"
version = "0.1.267"
edition = "2021"
[dependencies]

View File

@@ -182,27 +182,18 @@ pub struct SubServiceMetric {
/// Backup system data
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BackupData {
pub repositories: Vec<String>,
pub repository_status: Status,
pub disks: Vec<BackupDiskData>,
}
/// Backup repository disk information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BackupDiskData {
pub serial: String,
pub product_name: Option<String>,
pub wear_percent: Option<f32>,
pub temperature_celsius: Option<f32>,
pub last_backup_time: Option<String>,
pub backup_status: Status,
pub disk_usage_percent: f32,
pub disk_used_gb: f32,
pub disk_total_gb: f32,
pub usage_status: Status,
pub services: Vec<String>,
pub archives_min: i64,
pub archives_max: i64,
pub repositories: Vec<BackupRepositoryData>,
}
/// Individual backup repository information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BackupRepositoryData {
pub name: String,
pub archive_count: i64,
pub repo_size_gb: f32,
pub status: Status,
}
impl AgentData {
@@ -245,9 +236,9 @@ impl AgentData {
},
services: Vec::new(),
backup: BackupData {
last_backup_time: None,
backup_status: Status::Unknown,
repositories: Vec::new(),
repository_status: Status::Unknown,
disks: Vec::new(),
},
}
}