]> git.proxmox.com Git - pmg-gui.git/commitdiff
add MailProcessing Component
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 10 Oct 2017 13:16:25 +0000 (15:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Oct 2017 04:52:42 +0000 (06:52 +0200)
this shows the traffic and the average mail processing time

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/Makefile
js/dashboard/MailProcessing.js [new file with mode: 0644]

index d9dd6a40b562c430cc9c9833d98c51c1aaa725c9..417091bff26bc81b405d24701d1c8ee6dccc1013 100644 (file)
@@ -26,6 +26,7 @@ JSSRC=                                                        \
        UserBlackWhiteList.js                           \
        QuarantineView.js                               \
        Dashboard.js                                    \
+       dashboard/MailProcessing.js                     \
        dashboard/SubscriptionInfo.js                   \
        dashboard/MiniGraph.js                          \
        VersionInfo.js                                  \
diff --git a/js/dashboard/MailProcessing.js b/js/dashboard/MailProcessing.js
new file mode 100644 (file)
index 0000000..42e2e2a
--- /dev/null
@@ -0,0 +1,54 @@
+Ext.define('PMG.dashboard.MailProcessing', {
+    extend: 'Ext.panel.Panel',
+    xtype: 'pmgMailProcessing',
+
+    setData: function(data) {
+       var me = this;
+       me.down('#ptime').update(data);
+       me.down('#traffic').update(data);
+    },
+
+    layout: {
+       type: 'hbox',
+       align: 'center',
+       pack: 'center'
+    },
+
+    defaults: {
+       xtype: 'box',
+       flex: 1,
+       style: {
+           'text-align':'center'
+       }
+    },
+
+    items: [
+       {
+           itemId: 'traffic',
+           data: {
+               in: 0,
+               out: 0
+           },
+           tpl: [
+               '<h3><i class="fa fa-exchange green"></i> ' + gettext('Traffic') + '</h3>',
+               '<table class="dash"><tr>',
+               '<td class="right half"><h2>{in}</h2></td>',
+               '<td class="left">' + PMG.Utils.format_rule_direction(0) + '</td>',
+               '</tr><tr>',
+               '<td class="right half"><h2>{out}</h2></td>',
+               '<td class="left">' + PMG.Utils.format_rule_direction(1) + '</td>',
+               '</tr></table>',
+           ]
+       },
+       {
+           itemId: 'ptime',
+           data: {
+               avgptime: 0,
+           },
+           tpl: [
+               '<h3><i class="fa fa-clock-o"></i> ' + gettext('Avg. Processing Time') + '</h3>',
+               '<p><h2>{ptime}</h2></p>'
+           ]
+       }
+    ]
+})