From 473f89fb5748748e22949b33796bc62557926f78 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 23 Oct 2025 18:19:14 +0200 Subject: [PATCH] Display mount points instead of pool names in storage section - Add mount_point field to StoragePool struct - Create mapping from pool names to mount points - Update display to show user-friendly mount points (/, /mnt/steampool) - Keep device detection for SMART data (temperature, wear) - Resolves disk name confusion on different hosts --- dashboard/src/ui/widgets/system.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index b44b36f..018fd3a 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -43,6 +43,7 @@ pub struct SystemWidget { #[derive(Clone)] struct StoragePool { name: String, + mount_point: String, pool_type: String, // "Single", "Raid0", etc. drives: Vec, usage_percent: Option, @@ -125,6 +126,17 @@ impl SystemWidget { } } + /// Get mount point for a pool name + fn get_mount_point_for_pool(&self, pool_name: &str) -> String { + match pool_name { + "root" => "/".to_string(), + "steampool" => "/mnt/steampool".to_string(), + "steampool_1" => "/steampool_1".to_string(), + "steampool_2" => "/steampool_2".to_string(), + _ => format!("/{}", pool_name), // Default fallback + } + } + /// Parse storage metrics into pools and drives fn update_storage_from_metrics(&mut self, metrics: &[&Metric]) { let mut pools: std::collections::HashMap = std::collections::HashMap::new(); @@ -132,8 +144,10 @@ impl SystemWidget { for metric in metrics { if metric.name.starts_with("disk_") { if let Some(pool_name) = self.extract_pool_name(&metric.name) { + let mount_point = self.get_mount_point_for_pool(&pool_name); let pool = pools.entry(pool_name.clone()).or_insert_with(|| StoragePool { name: pool_name.clone(), + mount_point: mount_point.clone(), pool_type: "Single".to_string(), // Default, could be enhanced drives: Vec::new(), usage_percent: None, @@ -246,7 +260,7 @@ impl SystemWidget { let pool_spans = StatusIcons::create_status_spans( pool.status.clone(), - &format!("{} ({}):", pool.name, pool.pool_type) + &format!("{} ({}):", pool.mount_point, pool.pool_type) ); lines.push(Line::from(pool_spans));