diff --git a/Cargo.lock b/Cargo.lock index f731b30..76b9d2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.113" +version = "0.1.114" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.113" +version = "0.1.114" dependencies = [ "anyhow", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.113" +version = "0.1.114" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 90baacc..0f9d899 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.113" +version = "0.1.114" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 23c091e..fc4ab38 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.113" +version = "0.1.114" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index d4a9ea8..b95d38d 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -391,8 +391,12 @@ impl SystemWidget { for suffix in known_suffixes { if after_fs.ends_with(suffix) { - let fs_name = after_fs[..after_fs.len() - suffix.len() - 1].to_string(); // Remove suffix + underscore - return (Some(fs_name), Some(suffix.to_string())); + // Safely calculate fs_name length + let suffix_with_underscore = suffix.len() + 1; + if after_fs.len() > suffix_with_underscore { + let fs_name = after_fs[..after_fs.len() - suffix_with_underscore].to_string(); + return (Some(fs_name), Some(suffix.to_string())); + } } } } diff --git a/shared/Cargo.toml b/shared/Cargo.toml index d65984d..4154abe 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.113" +version = "0.1.114" edition = "2021" [dependencies]