]>
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
.toString() +
45 ' - ' + end
.toString() + '<br>' +
46 'Count: ' + record
.get(item
.field
));
53 Ext
.define('PMG.HourlyMailDistribution', {
54 extend
: 'Ext.panel.Panel',
55 xtype
: 'pmgHourlyMailDistribution',
60 bodyPadding
: '10 0 0 0',
68 title
: gettext('Statistics') + ': ' + gettext('Hourly Distribution'),
70 tbar
: [ { xtype
: 'pmgStatTimeSelector' } ],
72 initComponent: function() {
75 var store
= Ext
.create('PMG.data.StatStore', {
76 staturl
: '/api2/json/statistics/maildistribution',
78 { type
: 'integer', name
: 'index' },
79 { type
: 'integer', name
: 'count' },
80 { type
: 'integer', name
: 'count_in' },
81 { type
: 'integer', name
: 'count_out' },
82 { type
: 'integer', name
: 'spamcount_in' },
83 { type
: 'integer', name
: 'spamcount_out' },
84 { type
: 'integer', name
: 'viruscount_in' },
85 { type
: 'integer', name
: 'viruscount_ou' },
86 { type
: 'integer', name
: 'bounces_in' },
87 { type
: 'integer', name
: 'bounces_out' }
93 xtype
: 'pmgMailDistChart',
94 title
: gettext('Incoming Mails'),
99 xtype
: 'pmgMailDistChart',
100 title
: gettext('Outgoing Mails'),
108 me
.on('destroy', store
.destroy
, store
);