Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0d571a40e | |||
| 977200fff3 | |||
| d692de5f83 | |||
| f5913dbd43 | |||
| faa30a7839 |
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.212"
|
||||
version = "0.1.215"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -301,7 +301,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.212"
|
||||
version = "0.1.215"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -324,7 +324,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.212"
|
||||
version = "0.1.215"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.213"
|
||||
version = "0.1.216"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -142,6 +142,11 @@ impl BackupCollector {
|
||||
// Build service list for this disk
|
||||
let services: Vec<String> = backup_status.services.keys().cloned().collect();
|
||||
|
||||
// Calculate total archives across all services on this disk
|
||||
let total_archives: i64 = backup_status.services.values()
|
||||
.map(|service| service.archive_count)
|
||||
.sum();
|
||||
|
||||
// Create disk data
|
||||
let disk_data = BackupDiskData {
|
||||
serial: backup_status.disk_serial_number.unwrap_or_else(|| "Unknown".to_string()),
|
||||
@@ -155,6 +160,7 @@ impl BackupCollector {
|
||||
disk_total_gb: total_gb,
|
||||
usage_status,
|
||||
services,
|
||||
total_archives,
|
||||
};
|
||||
|
||||
disks.push(disk_data);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.213"
|
||||
version = "0.1.216"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -517,19 +517,23 @@ impl SystemWidget {
|
||||
let repo_spans = StatusIcons::create_status_spans(self.backup_repository_status, &repo_text);
|
||||
lines.push(Line::from(repo_spans));
|
||||
|
||||
// List all repositories
|
||||
let repo_count = self.backup_repositories.len();
|
||||
for (idx, repo) in self.backup_repositories.iter().enumerate() {
|
||||
// List all repositories (sorted for consistent display)
|
||||
let mut sorted_repos = self.backup_repositories.clone();
|
||||
sorted_repos.sort();
|
||||
let repo_count = sorted_repos.len();
|
||||
for (idx, repo) in sorted_repos.iter().enumerate() {
|
||||
let tree_char = if idx == repo_count - 1 { "└─" } else { "├─" };
|
||||
lines.push(Line::from(vec![
|
||||
Span::styled(format!(" {} ", tree_char), Typography::tree()),
|
||||
Span::styled(repo, Typography::secondary()),
|
||||
Span::styled(repo.clone(), Typography::secondary()),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
// Second section: Per-disk backup information
|
||||
for disk in &self.backup_disks {
|
||||
// Second section: Per-disk backup information (sorted by serial for consistent display)
|
||||
let mut sorted_disks = self.backup_disks.clone();
|
||||
sorted_disks.sort_by(|a, b| a.serial.cmp(&b.serial));
|
||||
for disk in &sorted_disks {
|
||||
let truncated_serial = truncate_serial(&disk.serial);
|
||||
let mut details = Vec::new();
|
||||
|
||||
@@ -561,9 +565,10 @@ impl SystemWidget {
|
||||
lines.push(Line::from(time_spans));
|
||||
}
|
||||
|
||||
// Show usage with status
|
||||
// Show usage with status and archive count
|
||||
let usage_text = format!(
|
||||
"Usage: {:.0}% {:.0}GB/{:.0}GB",
|
||||
"Usage: ({}) {:.0}% {:.0}GB/{:.0}GB",
|
||||
disk.total_archives,
|
||||
disk.disk_usage_percent,
|
||||
disk.disk_used_gb,
|
||||
disk.disk_total_gb
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.213"
|
||||
version = "0.1.216"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -195,6 +195,7 @@ pub struct BackupDiskData {
|
||||
pub disk_total_gb: f32,
|
||||
pub usage_status: Status,
|
||||
pub services: Vec<String>,
|
||||
pub total_archives: i64,
|
||||
}
|
||||
|
||||
impl AgentData {
|
||||
|
||||
Reference in New Issue
Block a user