Simplify NFS export options display
All checks were successful
Build and Release / build-and-release (push) Successful in 1m14s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m14s
Filter NFS export options to show only key settings (rw/ro, sync/async) instead of verbose option strings. Improves readability while maintaining essential information about export configuration.
This commit is contained in:
parent
7362464b46
commit
a34b095857
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.271"
|
version = "0.1.272"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -301,7 +301,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.271"
|
version = "0.1.272"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -325,7 +325,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.271"
|
version = "0.1.272"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.272"
|
version = "0.1.273"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1062,21 +1062,39 @@ impl SystemdCollector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Format: "/path/to/export hostname(options)" or "/path/to/export 192.168.1.0/24(options)"
|
// Format: "/path/to/export hostname(options)" or "/path/to/export 192.168.1.0/24(options)"
|
||||||
// exportfs -v shows each export once per client/network
|
// Split only at first whitespace to get path and rest
|
||||||
// We want to deduplicate by path and just show one entry
|
let parts: Vec<&str> = line.splitn(2, char::is_whitespace).collect();
|
||||||
let parts: Vec<&str> = line.split_whitespace().collect();
|
|
||||||
if parts.is_empty() {
|
if parts.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let export_path = parts[0].to_string();
|
let export_path = parts[0].trim().to_string();
|
||||||
|
|
||||||
// Extract options from parentheses (from the client specification)
|
// Find options in parentheses from the entire rest of the line
|
||||||
let options = if parts.len() > 1 {
|
let options = if parts.len() > 1 {
|
||||||
let client_spec = parts[1];
|
let rest = parts[1].trim();
|
||||||
if let Some(start) = client_spec.find('(') {
|
// Find all text in parentheses (there might be spaces before the parentheses)
|
||||||
if let Some(end) = client_spec.find(')') {
|
if let Some(start) = rest.find('(') {
|
||||||
client_spec[start+1..end].to_string()
|
if let Some(end) = rest.find(')') {
|
||||||
|
// Extract key options only: rw/ro, sync/async
|
||||||
|
let opts = rest[start+1..end].to_string();
|
||||||
|
// Simplify options to just show key ones
|
||||||
|
let mut key_opts = Vec::new();
|
||||||
|
if opts.contains("rw") {
|
||||||
|
key_opts.push("rw");
|
||||||
|
} else if opts.contains("ro") {
|
||||||
|
key_opts.push("ro");
|
||||||
|
}
|
||||||
|
if opts.contains("sync") {
|
||||||
|
key_opts.push("sync");
|
||||||
|
} else if opts.contains("async") {
|
||||||
|
key_opts.push("async");
|
||||||
|
}
|
||||||
|
if !key_opts.is_empty() {
|
||||||
|
key_opts.join(",")
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.272"
|
version = "0.1.273"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.272"
|
version = "0.1.273"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user