Fix filesystem children creation logic
All checks were successful
Build and Release / build-and-release (push) Successful in 1m17s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m17s
- Allow filesystem entries to be created with any metric, not just mount_point - Ensure filesystem children appear under physical drive pools - Improve mount point fallback logic for better compatibility
This commit is contained in:
@@ -256,16 +256,20 @@ impl SystemWidget {
|
||||
});
|
||||
|
||||
if !fs_exists {
|
||||
// Only create filesystem entry if we have the mount_point metric
|
||||
// This ensures we get the correct mount point path
|
||||
if metric_type != "mount_point" {
|
||||
continue; // Skip non-mount_point metrics if filesystem doesn't exist yet
|
||||
}
|
||||
|
||||
let mount_point = if let MetricValue::String(mount) = &metric.value {
|
||||
mount.clone()
|
||||
// Create filesystem entry with correct mount point
|
||||
let mount_point = if metric_type == "mount_point" {
|
||||
if let MetricValue::String(mount) = &metric.value {
|
||||
mount.clone()
|
||||
} else {
|
||||
// Fallback: handle special cases
|
||||
if fs_name == "root" {
|
||||
"/".to_string()
|
||||
} else {
|
||||
format!("/{}", fs_name.replace('_', "/"))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Fallback: handle special cases
|
||||
// Fallback for non-mount_point metrics: generate mount point from fs_name
|
||||
if fs_name == "root" {
|
||||
"/".to_string()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user