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:
parent
c3626cc362
commit
fab6404cca
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.103"
|
version = "0.1.104"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -301,7 +301,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.103"
|
version = "0.1.104"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -324,7 +324,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.103"
|
version = "0.1.104"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.104"
|
version = "0.1.105"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.104"
|
version = "0.1.105"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -256,13 +256,9 @@ impl SystemWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if !fs_exists {
|
if !fs_exists {
|
||||||
// Only create filesystem entry if we have the mount_point metric
|
// Create filesystem entry with correct mount point
|
||||||
// This ensures we get the correct mount point path
|
let mount_point = if metric_type == "mount_point" {
|
||||||
if metric_type != "mount_point" {
|
if let MetricValue::String(mount) = &metric.value {
|
||||||
continue; // Skip non-mount_point metrics if filesystem doesn't exist yet
|
|
||||||
}
|
|
||||||
|
|
||||||
let mount_point = if let MetricValue::String(mount) = &metric.value {
|
|
||||||
mount.clone()
|
mount.clone()
|
||||||
} else {
|
} else {
|
||||||
// Fallback: handle special cases
|
// Fallback: handle special cases
|
||||||
@ -271,6 +267,14 @@ impl SystemWidget {
|
|||||||
} else {
|
} else {
|
||||||
format!("/{}", fs_name.replace('_', "/"))
|
format!("/{}", fs_name.replace('_', "/"))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Fallback for non-mount_point metrics: generate mount point from fs_name
|
||||||
|
if fs_name == "root" {
|
||||||
|
"/".to_string()
|
||||||
|
} else {
|
||||||
|
format!("/{}", fs_name.replace('_', "/"))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pool.filesystems.push(FileSystem {
|
pool.filesystems.push(FileSystem {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.104"
|
version = "0.1.105"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user