]>
Commit | Line | Data |
---|---|---|
046e640c DC |
1 | Ext.define('PVE.widget.HealthWidget', { |
2 | extend: 'Ext.Component', | |
3 | alias: 'widget.pveHealthWidget', | |
4 | ||
5 | data: { | |
6 | iconCls: PVE.Utils.get_health_icon(undefined, true), | |
7 | text: '', | |
8 | title: '' | |
9 | }, | |
10 | ||
11 | style: { | |
12 | 'text-align':'center' | |
13 | }, | |
14 | ||
15 | tpl: [ | |
16 | '<h3>{title}</h3>', | |
17 | '<i class="fa fa-5x {iconCls}"></i>', | |
18 | '<br /><br/>', | |
19 | '{text}' | |
20 | ], | |
21 | ||
22 | updateHealth: function(data) { | |
23 | var me = this; | |
24 | me.update(Ext.apply(me.data, data)); | |
25 | }, | |
26 | ||
27 | initComponent: function(){ | |
28 | var me = this; | |
29 | ||
30 | if (me.title) { | |
31 | me.config.data.title = me.title; | |
32 | } | |
33 | ||
34 | me.callParent(); | |
35 | } | |
36 | ||
37 | }); |