]> git.proxmox.com Git - proxmox-backup.git/commitdiff
api: disk list: sort by name
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 9 Jul 2021 10:32:35 +0000 (12:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Jul 2021 11:02:30 +0000 (13:02 +0200)
So callers get more stable results. Most noticeable, the disk list in
the web UI doesn't jump around upon reloading, and while sorting could
be done directly there, like this other callers get the benefit too.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/api2/node/disks/mod.rs

index 445541577415b2769d44ebb6ed0cd8f3ef7ffd13..e0c3d39cd46ba2b83ddba312d634ac366db4c0ab 100644 (file)
@@ -66,6 +66,8 @@ pub fn list_disks(
         }
     }
 
+    list.sort_by(|a, b| a.name.cmp(&b.name));
+
     Ok(list)
 }