Fix mount point ordering consistency
- Sort filesystems by mount point in disk collector for consistent display - Sort tmpfs mounts by mount point in memory collector - Eliminates random swapping of / and /boot order between refreshes - Eliminates random swapping of tmpfs mount order in RAM section Ensures predictable, alphabetical ordering for all mount points.
This commit is contained in:
parent
fd7ad23205
commit
4d615a7f45
@ -412,7 +412,7 @@ impl DiskCollector {
|
||||
for drive in physical_drives {
|
||||
let smart = smart_data.get(&drive.name);
|
||||
|
||||
let filesystems: Vec<FilesystemData> = drive.filesystems.iter().map(|fs| {
|
||||
let mut filesystems: Vec<FilesystemData> = drive.filesystems.iter().map(|fs| {
|
||||
FilesystemData {
|
||||
mount: fs.mount_point.clone(), // This preserves "/" and "/boot" correctly
|
||||
usage_percent: fs.usage_percent,
|
||||
@ -421,6 +421,9 @@ impl DiskCollector {
|
||||
}
|
||||
}).collect();
|
||||
|
||||
// Sort filesystems by mount point for consistent display order
|
||||
filesystems.sort_by(|a, b| a.mount.cmp(&b.mount));
|
||||
|
||||
agent_data.system.storage.drives.push(DriveData {
|
||||
name: drive.name.clone(),
|
||||
health: smart.map(|s| s.health.clone()).unwrap_or_else(|| drive.health.clone()),
|
||||
|
||||
@ -153,6 +153,9 @@ impl MemoryCollector {
|
||||
});
|
||||
}
|
||||
|
||||
// Sort tmpfs mounts by mount point for consistent display order
|
||||
agent_data.system.memory.tmpfs.sort_by(|a, b| a.mount.cmp(&b.mount));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user