]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: ceph: add more compatibilty code for versions
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 12 Nov 2021 16:01:04 +0000 (17:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 12 Nov 2021 16:02:27 +0000 (17:02 +0100)
we now have to handle the version of 'old' nodes, as well as the
new nodes, which are missing the 'version' field in the metadata/osd call

so set the 'versions' object to a default empty object for osds
and get the host version directly from the treenode
(the parent node of the osd node)

also compare the host version in the dashboard by getting first the
new version field, and the old one as fallback.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/ceph/OSD.js
www/manager6/ceph/Services.js

index b21209567cd36156fe63d0f7a636fe900f7cce56..9e7378523782bbf7670017e162e21c578c80561f 100644 (file)
@@ -316,7 +316,7 @@ Ext.define('PVE.node.CephOsdTree', {
                    if (selected.length) {
                        name = selected[0].data.name;
                    }
-                   vm.set('versions', data.versions);
+                   vm.set('versions', data.versions || {});
                    // extract max version
                    let maxversion = "0";
                    let mixedversions = false;
@@ -507,7 +507,8 @@ Ext.define('PVE.node.CephOsdTree', {
            let version = value || "";
            let maxversion = vm.get('maxversion');
            if (value && PVE.Utils.compare_ceph_versions(value, maxversion) !== 0) {
-               if (rec.data.type === 'host' || PVE.Utils.compare_ceph_versions(versions[rec.data.host] || "", maxversion) !== 0) {
+               let host_version = rec.parentNode?.data?.version || versions[rec.data.host] || "";
+               if (rec.data.type === 'host' || PVE.Utils.compare_ceph_versions(host_version, maxversion) !== 0) {
                    icon = PVE.Utils.get_ceph_icon_html('HEALTH_UPGRADE');
                } else {
                    icon = PVE.Utils.get_ceph_icon_html('HEALTH_OLD');
index 4fc9d0af48f8e7e36bf9eaf18cbcc16807118bbe..77ade27be37f53cff58a2dae9629c68e8e82b866 100644 (file)
@@ -184,7 +184,8 @@ Ext.define('PVE.ceph.Services', {
                    result.statuses.push(gettext('Version') + ": " + result.version);
 
                    if (PVE.Utils.compare_ceph_versions(result.version, maxversion) !== 0) {
-                       if (metadata.version[host] === maxversion) {
+                       let host_version = metadata.node[host]?.version?.parts || metadata.version?[host] || "";
+                       if (PVE.Utils.compare_ceph_versions(host_version, maxversion) === 0) {
                            if (result.health > healthstates.HEALTH_OLD) {
                                result.health = healthstates.HEALTH_OLD;
                            }