]>
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',
58 bodyPadding
: '0 0 10 0',
63 title
: gettext('Hourly Distribution'),
65 tbar
: [ { xtype
: 'pmgStatTimeSelector' } ],
67 initComponent: function() {
70 var store
= Ext
.create('PMG.data.StatStore', {
71 staturl
: '/api2/json/statistics/maildistribution',
73 { type
: 'integer', name
: 'index' },
74 { type
: 'integer', name
: 'count' },
75 { type
: 'integer', name
: 'count_in' },
76 { type
: 'integer', name
: 'count_out' },
77 { type
: 'integer', name
: 'spamcount_in' },
78 { type
: 'integer', name
: 'spamcount_out' },
79 { type
: 'integer', name
: 'viruscount_in' },
80 { type
: 'integer', name
: 'viruscount_ou' },
81 { type
: 'integer', name
: 'bounces_in' },
82 { type
: 'integer', name
: 'bounces_out' },
88 xtype
: 'pmgMailDistChart',
89 title
: gettext('Incoming Mails'),
94 xtype
: 'pmgMailDistChart',
95 title
: gettext('Outgoing Mails'),
103 me
.on('destroy', store
.destroy
, store
);