]> git.proxmox.com Git - pmg-gui.git/blob - js/dashboard/MailProcessing.js
improve gettext usage
[pmg-gui.git] / js / dashboard / MailProcessing.js
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',
14 pack: 'center'
15 },
16
17 defaults: {
18 xtype: 'box',
19 flex: 1,
20 style: {
21 'text-align':'center'
22 }
23 },
24
25 items: [
26 {
27 itemId: 'traffic',
28 data: {
29 'bytes_in': 0,
30 'bytes_out': 0
31 },
32 tpl: [
33 '<h3><i class="fa fa-exchange green"></i> ' + gettext('Traffic') + '</h3>',
34 '<table class="dash"><tr>',
35 '<td class="right half"><h2>{bytes_in}</h2></td>',
36 '<td class="left">' + PMG.Utils.format_rule_direction(0) + '</td>',
37 '</tr><tr>',
38 '<td class="right half"><h2>{bytes_out}</h2></td>',
39 '<td class="left">' + PMG.Utils.format_rule_direction(1) + '</td>',
40 '</tr></table>'
41 ]
42 },
43 {
44 itemId: 'ptime',
45 data: {
46 'avg_ptime': 0
47 },
48 tpl: [
49 '<h3><i class="fa fa-clock-o"></i> ' + gettext('Avg. Mail Processing Time') + '</h3>',
50 '<p><h2>{avg_ptime}</h2></p>'
51 ]
52 }
53 ]
54 });