]>
Commit | Line | Data |
---|---|---|
5c696784 DC |
1 | Ext.define('PMG.dashboard.MailProcessing', { |
2 | extend: 'Ext.panel.Panel', | |
3 | xtype: 'pmgMailProcessing', | |
4 | ||
5 | setData: function(data) { | |
6 | var me = this; | |
7 | me.down('#ptime').update(data); | |
8 | me.down('#traffic').update(data); | |
9 | }, | |
10 | ||
11 | layout: { | |
12 | type: 'hbox', | |
13 | align: 'center', | |
c87d46fb | 14 | pack: 'center', |
5c696784 DC |
15 | }, |
16 | ||
17 | defaults: { | |
18 | xtype: 'box', | |
19 | flex: 1, | |
20 | style: { | |
c87d46fb TL |
21 | 'text-align': 'center', |
22 | }, | |
5c696784 DC |
23 | }, |
24 | ||
25 | items: [ | |
26 | { | |
27 | itemId: 'traffic', | |
28 | data: { | |
7b18f75e | 29 | 'bytes_in': 0, |
c87d46fb | 30 | 'bytes_out': 0, |
5c696784 DC |
31 | }, |
32 | tpl: [ | |
33 | '<h3><i class="fa fa-exchange green"></i> ' + gettext('Traffic') + '</h3>', | |
34 | '<table class="dash"><tr>', | |
7b18f75e | 35 | '<td class="right half"><h2>{bytes_in}</h2></td>', |
5c696784 DC |
36 | '<td class="left">' + PMG.Utils.format_rule_direction(0) + '</td>', |
37 | '</tr><tr>', | |
7b18f75e | 38 | '<td class="right half"><h2>{bytes_out}</h2></td>', |
5c696784 | 39 | '<td class="left">' + PMG.Utils.format_rule_direction(1) + '</td>', |
c87d46fb TL |
40 | '</tr></table>', |
41 | ], | |
5c696784 DC |
42 | }, |
43 | { | |
44 | itemId: 'ptime', | |
45 | data: { | |
c87d46fb | 46 | 'avg_ptime': 0, |
5c696784 DC |
47 | }, |
48 | tpl: [ | |
64fb657f | 49 | '<h3><i class="fa fa-clock-o"></i> ' + gettext('Avg. Mail Processing Time') + '</h3>', |
c87d46fb TL |
50 | '<p><h2>{avg_ptime}</h2></p>', |
51 | ], | |
52 | }, | |
53 | ], | |
131ba4f6 | 54 | }); |