all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 2/2] DiskList: render osdid-list if present
Date: Tue, 22 Aug 2023 11:04:56 +0200	[thread overview]
Message-ID: <20230822090456.929773-3-a.lauterer@proxmox.com> (raw)
In-Reply-To: <20230822090456.929773-1-a.lauterer@proxmox.com>

Render all OSD IDs in 'osdid-list' if the parameter is present.

It is possible to have multiple OSD daemons on a disk. We want to list
them all in the UI.
Fall back to the 'osdid' parameter if 'osdid-list' is not available.

We check rec.data['osdid-list'] against its general truthiness as it
might not be present at all or null.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 src/panel/DiskList.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/panel/DiskList.js b/src/panel/DiskList.js
index c5a0050..4808f5c 100644
--- a/src/panel/DiskList.js
+++ b/src/panel/DiskList.js
@@ -220,7 +220,11 @@ Ext.define('Proxmox.DiskList', {
 	let extendedInfo = '';
 	if (rec) {
 	    let types = [];
-	    if (rec.data.osdid !== undefined && rec.data.osdid >= 0) {
+	    if (rec.data['osdid-list'] && rec.data['osdid-list'].length > 0) {
+		for (const id of rec.data['osdid-list'].sort()) {
+		    types.push(`OSD.${id.toString()}`);
+		}
+	    } else if (rec.data.osdid !== undefined && rec.data.osdid >= 0) {
 		types.push(`OSD.${rec.data.osdid.toString()}`);
 	    }
 	    if (rec.data.journals > 0) {
-- 
2.39.2





  parent reply	other threads:[~2023-08-22  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  9:04 [pve-devel] [PATCH storage/widget-toolkit 0/2] List all OSDs on disk Aaron Lauterer
2023-08-22  9:04 ` [pve-devel] [PATCH storage 1/2] disks: get: add osdid-list return parameter Aaron Lauterer
2023-08-22  9:04 ` Aaron Lauterer [this message]
2023-09-28 13:21 ` [pve-devel] [PATCH storage/widget-toolkit 0/2] List all OSDs on disk Aaron Lauterer
2023-11-13 16:01 ` [pve-devel] applied.series: " 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=20230822090456.929773-3-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal