[pve-devel] [PATCH manager 06/15] gui: ceph: add get_ceph_icon_html to utils

Dominik Csapak d.csapak at proxmox.com
Mon May 27 14:13:57 CEST 2019


returns html code for a ceph health icon, will be used in Services.js

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

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 87457078..a159445b 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -102,6 +102,15 @@ Ext.define('PVE.Utils', { utilities: {
 	return icon;
     },
 
+    get_ceph_icon_html: function(health, fw) {
+	var state = PVE.Utils.map_ceph_health[health];
+	var cls = PVE.Utils.get_health_icon(state);
+	if (fw) {
+	    cls += ' fa-fw';
+	}
+	return "<i class='fa " + cls + "'></i> ";
+    },
+
     map_ceph_health: {
 	'HEALTH_OK':'good',
 	'HEALTH_OLD':'old',
-- 
2.11.0





More information about the pve-devel mailing list