[pve-devel] [PATCH manager 5/5] adapt the health message list to luminous

Dominik Csapak d.csapak at proxmox.com
Thu Jul 20 16:16:14 CEST 2017


they restructured the json structure, so we have to adapt to it.
additionally, we now have a 'detail' property for the messages
which we show on a click of the 'info' button in the new actioncolumn

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/ceph/Status.js | 49 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/Status.js b/www/manager6/ceph/Status.js
index d630e71b..b5130986 100644
--- a/www/manager6/ceph/Status.js
+++ b/www/manager6/ceph/Status.js
@@ -67,6 +67,35 @@ Ext.define('PVE.node.CephStatus', {
 			    dataIndex: 'summary',
 			    header: gettext('Summary'),
 			    flex: 1
+			},
+			{
+			    xtype: 'actioncolumn',
+			    width: 40,
+			    align: 'center',
+			    tooltip: gettext('Detail'),
+			    items: [
+				{
+				    iconCls: 'x-fa fa-info-circle',
+				    handler: function(grid, rowindex, colindex, item, e, record) {
+					var win = Ext.create('Ext.window.Window', {
+					    title: gettext('Detail'),
+					    resizable: true,
+					    width: 650,
+					    height: 400,
+					    layout: {
+						type: 'fit'
+					    },
+					    items: [{
+						scrollable: true,
+						padding: '10',
+						xtype: 'box',
+						html: record.data.detail
+					    }]
+					});
+					win.show();
+				    }
+				}
+			    ]
 			}
 		    ]
 		}
@@ -139,6 +168,24 @@ Ext.define('PVE.node.CephStatus', {
 	}
     ],
 
+    generateCheckData: function(health) {
+	var result = [];
+	var checks = health.checks || {};
+	var keys = Ext.Object.getKeys(checks).sort();
+
+	Ext.Array.forEach(keys, function(key) {
+	    var details = checks[key].detail || [];
+	    result.push({
+		id: key,
+		summary: checks[key].message,
+		detail: details.join("<br>\n"),
+		severity: checks[key].severity
+	    });
+	});
+
+	return result;
+    },
+
     updateAll: function(store, records, success) {
 	if (!success || records.length === 0) {
 	    return;
@@ -150,7 +197,7 @@ Ext.define('PVE.node.CephStatus', {
 	// add health panel
 	me.down('#overallhealth').updateHealth(PVE.Utils.render_ceph_health(rec.data.health || {}));
 	// add errors to gridstore
-	me.down('#warnings').getStore().loadRawData(rec.data.health.summary, false);
+	me.down('#warnings').getStore().loadRawData(me.generateCheckData(rec.data.health || {}), false);
 
 	// update detailstatus panel
 	me.getComponent('statusdetail').updateAll(
-- 
2.11.0





More information about the pve-devel mailing list