]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/DomainStatistics.js
mobile: fix subscription check
[pmg-gui.git] / js / DomainStatistics.js
index 9bce8aefb6a4c44b85c8933272467a59b5aa881c..190fe2944e58e2f08b243a0fd26a26862799f359 100644 (file)
@@ -1,11 +1,10 @@
-/*global Proxmox*/
 Ext.define('PMG.DomainStatistics', {
     extend: 'Ext.panel.Panel',
     xtype: 'pmgDomainStatistics',
 
     title: gettext('Statistics') + ': ' + gettext('Domain'),
 
-    tbar: [ { xtype: 'pmgStatTimeSelector' } ],
+    tbar: [{ xtype: 'pmgStatTimeSelector' }],
 
     layout: 'fit',
     border: false,
@@ -22,22 +21,22 @@ Ext.define('PMG.DomainStatistics', {
            { type: 'integer', name: 'viruscount_in' },
            { type: 'integer', name: 'viruscount_out' },
            { type: 'number', name: 'bytes_in' },
-           { type: 'number', name: 'bytes_out' }
+           { type: 'number', name: 'bytes_out' },
        ];
 
        var store = Ext.create('PMG.data.StatStore', {
            staturl: '/api2/json/statistics/domains',
-           fields: fields
+           fields: fields,
        });
 
        var store_in = Ext.create('Ext.data.ArrayStore', {
            fields: fields,
-           filters: [ function(item) { return item.data.count_in > 0; } ]
+           filters: [function(item) { return item.data.count_in > 0; }],
        });
 
        var store_out = Ext.create('Ext.data.ArrayStore', {
            fields: fields,
-           filters: [ function(item) { return item.data.count_out > 0; } ]
+           filters: [function(item) { return item.data.count_out > 0; }],
        });
 
        store.on('load', function(s, records, successful) {
@@ -66,7 +65,7 @@ Ext.define('PMG.DomainStatistics', {
                    store: store_in,
                    emptyText: gettext('No data in database'),
                    viewConfig: {
-                       deferEmptyText: false
+                       deferEmptyText: false,
                    },
                    columns: [
                        {
@@ -74,33 +73,33 @@ Ext.define('PMG.DomainStatistics', {
                                gettext('Receiver') + ')',
                            flex: 1,
                            renderer: render_domain,
-                           dataIndex: 'domain'
+                           dataIndex: 'domain',
                        },
                        {
                            text: gettext('Traffic') + ' (MB)',
                            dataIndex: 'bytes_in',
                            renderer: function(v) {
                                return Ext.Number.toFixed(v/(1024*1024), 2);
-                           }
+                           },
                        },
                        {
                            text: gettext('Count'),
                            columns: [
                                {
                                    text: gettext('Mail'),
-                                   dataIndex: 'count_in'
+                                   dataIndex: 'count_in',
                                },
                                {
                                    header: gettext('Virus'),
-                                   dataIndex: 'viruscount_in'
+                                   dataIndex: 'viruscount_in',
                                },
                                {
                                    header: gettext('Spam'),
-                                   dataIndex: 'spamcount_in'
-                               }
-                           ]
-                       }
-                   ]
+                                   dataIndex: 'spamcount_in',
+                               },
+                           ],
+                       },
+                   ],
                },
                {
                    xtype: 'grid',
@@ -110,7 +109,7 @@ Ext.define('PMG.DomainStatistics', {
                    store: store_out,
                    emptyText: gettext('No data in database'),
                    viewConfig: {
-                       deferEmptyText: false
+                       deferEmptyText: false,
                    },
                    columns: [
                        {
@@ -118,31 +117,31 @@ Ext.define('PMG.DomainStatistics', {
                                gettext('Receiver') + ')',
                            flex: 1,
                            renderer: render_domain,
-                           dataIndex: 'domain'
+                           dataIndex: 'domain',
                        },
                        {
                            text: gettext('Traffic') + ' (MB)',
                            dataIndex: 'bytes_out',
                            renderer: function(v) {
                                return Ext.Number.toFixed(v/(1024*1024), 2);
-                           }
+                           },
                        },
                        {
                            text: gettext('Count'),
                            columns: [
                                {
                                    text: gettext('Mail'),
-                                   dataIndex: 'count_out'
+                                   dataIndex: 'count_out',
                                },
                                {
                                    header: gettext('Virus'),
-                                   dataIndex: 'viruscount_out'
-                               }
-                           ]
-                       }
-                   ]
-               }
-           ]
+                                   dataIndex: 'viruscount_out',
+                               },
+                           ],
+                       },
+                   ],
+               },
+           ],
        }];
 
        me.callParent();
@@ -150,5 +149,5 @@ Ext.define('PMG.DomainStatistics', {
        Proxmox.Utils.monStoreErrors(me, store);
 
        me.on('destroy', store.destroy, store);
-    }
+    },
 });