From: Fabian Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH v3 proxmox-backup 3/3] api: disk list: sort by name
Date: Fri, 9 Jul 2021 12:32:35 +0200 [thread overview]
Message-ID: <20210709103235.79800-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210709103235.79800-1-f.ebner@proxmox.com>
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>
---
New in v3.
Does not depend on the other patches.
src/api2/node/disks/mod.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/api2/node/disks/mod.rs b/src/api2/node/disks/mod.rs
index 44554157..e0c3d39c 100644
--- a/src/api2/node/disks/mod.rs
+++ b/src/api2/node/disks/mod.rs
@@ -66,6 +66,8 @@ pub fn list_disks(
}
}
+ list.sort_by(|a, b| a.name.cmp(&b.name));
+
Ok(list)
}
--
2.30.2
next prev parent reply other threads:[~2021-07-09 10:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 10:32 [pbs-devel] [PATCH v3 proxmox-backup 1/3] disks: refactor partition type handling Fabian Ebner
2021-07-09 10:32 ` [pbs-devel] [PATCH v3 proxmox-backup 2/3] disks: also check for file systems with lsblk Fabian Ebner
2021-07-09 10:32 ` Fabian Ebner [this message]
2021-07-09 11:02 ` [pbs-devel] applied-series: [PATCH v3 proxmox-backup 1/3] disks: refactor partition type handling Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210709103235.79800-3-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox