pve-manager/www/manager6/panel/HealthWidget.js
Dominik Csapak 046e640c54 refactor health status widget and ceph status data
this adds a new component health widget, used for cluster and ceph
status

also refactor ceph error levels and ceph status data into PVE.Utils

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-22 16:37:09 +01:00

38 lines
585 B
JavaScript

Ext.define('PVE.widget.HealthWidget', {
extend: 'Ext.Component',
alias: 'widget.pveHealthWidget',
data: {
iconCls: PVE.Utils.get_health_icon(undefined, true),
text: '',
title: ''
},
style: {
'text-align':'center'
},
tpl: [
'<h3>{title}</h3>',
'<i class="fa fa-5x {iconCls}"></i>',
'<br /><br/>',
'{text}'
],
updateHealth: function(data) {
var me = this;
me.update(Ext.apply(me.data, data));
},
initComponent: function(){
var me = this;
if (me.title) {
me.config.data.title = me.title;
}
me.callParent();
}
});