]>
git.proxmox.com Git - pmg-gui.git/blob - js/SenderStatistics.js
2 /*jslint confusion: true*/
3 /* filter is a function and object */
4 Ext
.define('PMG.SenderDetails', {
5 extend
: 'Ext.grid.GridPanel',
6 xtype
: 'pmgSenderDetails',
14 html
: gettext('Please select a sender.')
18 disableSelection
: true,
20 plugins
: 'gridfilters',
22 setUrl: function(url
, title
) {
26 me
.store
.setRemoteFilter(url
!== undefined);
27 Proxmox
.Utils
.setErrorMask(me
, false);
30 var infopanel
= me
.getComponent('info');
32 infopanel
.update(title
);
34 infopanel
.update(gettext('Please select a sender.'));
42 remoteFilter
: false, // enabled dynamically
44 'receiver', 'virusinfo',
45 { type
: 'integer', name
: 'bytes' },
46 { type
: 'boolean', name
: 'blocked' },
47 { type
: 'integer', name
: 'spamlevel' },
48 { type
: 'date', dateFormat
: 'timestamp', name
: 'time' }
51 type
: 'pmgfilterproxy',
52 filterId
: 'x-gridfilter-receiver',
65 text
: gettext('Receiver'),
66 renderer
: Ext
.htmlEncode
,
68 filter
: { type
: 'string' },
72 header
: gettext('Size') + ' (KB)',
73 renderer: function(v
) { return Ext
.Number
.toFixed(v
/1024, 0); },
78 header
: gettext('Date'),
84 header
: gettext('Time'),
90 initComponent: function() {
94 Proxmox
.Utils
.monStoreErrors(me
, me
.store
, true);
98 Ext
.define('PMG.SenderList', {
99 extend
: 'Ext.grid.GridPanel',
100 alias
: 'widget.pmgSenderList',
102 title
: gettext('Statistics') + ': ' + gettext('Sender') +
103 ' (' + gettext('Outgoing') +')',
105 multiColumnSort
: true,
106 plugins
: 'gridfilters',
108 emptyText
: gettext('No data in database.'),
110 deferEmptyText
: false
113 tbar
: [ { xtype
: 'pmgStatTimeSelector' } ],
116 type
: 'pmgStatStore',
117 staturl
: '/api2/json/statistics/sender',
122 { type
: 'integer', name
: 'count' },
123 { type
: 'integer', name
: 'bytes' },
124 { type
: 'integer', name
: 'viruscount' }
127 type
: 'pmgfilterproxy',
128 sortParam
: 'orderby',
129 filterId
: 'x-gridfilter-sender'
149 text
: gettext('Sender'),
151 renderer
: Ext
.htmlEncode
,
156 // any Ext.form.field.Text configs accepted
161 text
: gettext('Count'),
164 text
: gettext('Mail'),
168 header
: gettext('Virus'),
169 dataIndex
: 'viruscount'
174 text
: gettext('Size') + ' (KB)',
176 renderer: function(v
) {
177 return Ext
.Number
.toFixed(v
/1024, 0);
182 initComponent: function() {
186 Proxmox
.Utils
.monStoreErrors(me
, me
.store
, true);
190 Ext
.define('PMG.SenderStatistics', {
191 extend
: 'Ext.panel.Panel',
192 xtype
: 'pmgSenderStatistics',
201 xclass
: 'Ext.app.ViewController',
203 selectionChange: function(grid
, selected
, eOpts
) {
204 var details
= this.lookupReference('details');
205 if (selected
.length
> 0) {
206 var sender
= selected
[0].data
.sender
;
207 var url
= "/api2/json/statistics/sender/" +
208 encodeURIComponent(sender
);
209 details
.setUrl(url
, '<b>' + gettext('Sender') + ':</b> ' + Ext
.htmlEncode(sender
));
218 xtype
: 'pmgSenderList',
219 multiColumnSort
: true,
224 listeners
: { selectionchange
: 'selectionChange' }
227 xtype
: 'pmgSenderDetails',
229 reference
: 'details',