]>
git.proxmox.com Git - pmg-gui.git/blob - js/HourlyMailDistribution.js
1 Ext
.define('PMG.MailDistChart', {
2 extend
: 'Ext.chart.CartesianChart',
3 xtype
: 'pmgMailDistChart',
11 title
: gettext('Count'),
21 initComponent: function() {
26 throw "cannot work without store";
30 throw "cannot work without a field";
41 renderer: function(tooltip
, record
, item
) {
42 var start
= record
.get('index');
44 tooltip
.setHtml('Time: ' + start
+ ' - ' + end
+ '<br>' +
45 'Count: ' + record
.get(item
.field
));
52 Ext
.define('PMG.HourlyMailDistribution', {
53 extend
: 'Ext.panel.Panel',
54 xtype
: 'pmgHourlyMailDistribution',
59 bodyPadding
: '10 0 0 0',
67 title
: gettext('Statistics') + ': ' + gettext('Hourly Distribution'),
69 tbar
: [ { xtype
: 'pmgStatTimeSelector' } ],
71 initComponent: function() {
74 var store
= Ext
.create('PMG.data.StatStore', {
75 staturl
: '/api2/json/statistics/maildistribution',
77 { type
: 'integer', name
: 'index' },
78 { type
: 'integer', name
: 'count' },
79 { type
: 'integer', name
: 'count_in' },
80 { type
: 'integer', name
: 'count_out' },
81 { type
: 'integer', name
: 'spamcount_in' },
82 { type
: 'integer', name
: 'spamcount_out' },
83 { type
: 'integer', name
: 'viruscount_in' },
84 { type
: 'integer', name
: 'viruscount_ou' },
85 { type
: 'integer', name
: 'bounces_in' },
86 { type
: 'integer', name
: 'bounces_out' },
92 xtype
: 'pmgMailDistChart',
93 title
: gettext('Incoming Mails'),
98 xtype
: 'pmgMailDistChart',
99 title
: gettext('Outgoing Mails'),
107 me
.on('destroy', store
.destroy
, store
);