]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
DiskList: render osdid-list if present
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 22 Aug 2023 09:04:56 +0000 (11:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 14:33:55 +0000 (15:33 +0100)
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

index c5a0050bc2aec2b1ab4768851a81a0b9cf1bb8b0..4808f5c7adf7fcd6cd9f163515e7062e58712247 100644 (file)
@@ -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) {