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 {
|
for drive in physical_drives {
|
||||||
let smart = smart_data.get(&drive.name);
|
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 {
|
FilesystemData {
|
||||||
mount: fs.mount_point.clone(), // This preserves "/" and "/boot" correctly
|
mount: fs.mount_point.clone(), // This preserves "/" and "/boot" correctly
|
||||||
usage_percent: fs.usage_percent,
|
usage_percent: fs.usage_percent,
|
||||||
@ -420,6 +420,9 @@ impl DiskCollector {
|
|||||||
total_gb: fs.total_bytes as f32 / (1024.0 * 1024.0 * 1024.0),
|
total_gb: fs.total_bytes as f32 / (1024.0 * 1024.0 * 1024.0),
|
||||||
}
|
}
|
||||||
}).collect();
|
}).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 {
|
agent_data.system.storage.drives.push(DriveData {
|
||||||
name: drive.name.clone(),
|
name: drive.name.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user