[pve-devel] [PATCH manager 2/3] ui: osd: details: add created_at and created_version

Aaron Lauterer a.lauterer at proxmox.com
Fri May 5 15:11:28 CEST 2023


Useful for OSDs created with at least Ceph version 17.2.6. For OSDs
created prior to that, we show "n/a".

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 www/manager6/ceph/OSDDetails.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/www/manager6/ceph/OSDDetails.js b/www/manager6/ceph/OSDDetails.js
index f0765d4f..43cf72d0 100644
--- a/www/manager6/ceph/OSDDetails.js
+++ b/www/manager6/ceph/OSDDetails.js
@@ -130,11 +130,32 @@ Ext.define('PVE.CephOsdDetails', {
 				    name: 'version',
 				    text: gettext('Version'),
 				},
+				{
+				    xtype: 'text',
+				    name: 'version_when_created',
+				    text: gettext('Version (created)'),
+				    renderer: function(value) {
+					// expects the following string format:
+					// ceph version 17.2.6 (995dec2cdae920da21db2d455e55efbc339bde24) quincy (stable)
+					if (value) {
+					    value = value.trim();
+					    let parts = value.split(' ');
+					    return `${parts[2]} (${parts[4]})`;
+					}
+					return gettext('n/a');
+				    },
+				},
 				{
 				    xtype: 'text',
 				    name: 'hostname',
 				    text: gettext('Hostname'),
 				},
+				{
+				    xtype: 'text',
+				    name: 'created_at',
+				    text: gettext('Creation time'),
+				    renderer: (v) => v ? Date(v).toLocaleString() : gettext('n/a'),
+				},
 				{
 				    xtype: 'text',
 				    name: 'osd_data',
-- 
2.30.2






More information about the pve-devel mailing list