xtype: 'panel',
itemId: 'info',
bodyPadding: 10,
- html: gettext('Please select a Contact.')
- }
+ html: gettext('Please select a contact'),
+ },
],
disableSelection: true,
+ plugins: 'gridfilters',
+
setUrl: function(url, title) {
var me = this;
me.store.setUrl(url);
+ me.store.setRemoteFilter(url !== undefined);
Proxmox.Utils.setErrorMask(me, false);
me.store.reload();
if (title) {
infopanel.update(title);
} else {
- infopanel.update(gettext('Please select a Contact'));
+ infopanel.update(gettext('Please select a contact'));
}
},
type: 'pmgStatStore',
autoReload: false,
remoteSort: true,
+ remoteFilter: false, // enabled dynamically
fields: [
'sender', 'virusinfo',
{ type: 'integer', name: 'bytes' },
{ type: 'boolean', name: 'blocked' },
{ type: 'integer', name: 'spamlevel' },
- { type: 'date', dateFormat: 'timestamp', name: 'time' }
+ { type: 'date', dateFormat: 'timestamp', name: 'time' },
],
proxy: {
- type: 'proxmox',
- sortParam: 'orderby'
+ type: 'pmgfilterproxy',
+ filterId: 'x-gridfilter-sender',
+ sortParam: 'orderby',
},
sorters: [
{
property: 'time',
- direction: 'ASC'
- }
- ]
+ direction: 'ASC',
+ },
+ ],
},
columns: [
text: gettext('Sender'),
renderer: Ext.htmlEncode,
flex: 1,
- dataIndex: 'sender'
+ filter: { type: 'string' },
+ dataIndex: 'sender',
},
{
header: gettext('Size') + ' (KB)',
renderer: function(v) { return Ext.Number.toFixed(v/1024, 0); },
- dataIndex: 'bytes'
+ dataIndex: 'bytes',
},
{
xtype: 'datecolumn',
header: gettext('Date'),
format: 'Y-m-d',
- dataIndex: 'time'
+ dataIndex: 'time',
},
{
xtype: 'datecolumn',
header: gettext('Time'),
- format: 'H:m:s',
- dataIndex: 'time'
+ format: 'H:i:s',
+ dataIndex: 'time',
},
],
me.callParent();
Proxmox.Utils.monStoreErrors(me, me.store, true);
- }
+ },
});
Ext.define('PMG.ContactList', {
extend: 'Ext.grid.GridPanel',
alias: 'widget.pmgContactList',
- title: gettext('Statistics') + ': ' + gettext('Contact'),
+ title: gettext('Statistics') + ': ' + gettext('Contact') +
+ ' (' + gettext('Receiver') + ', ' + gettext('Outgoing') +')',
multiColumnSort: true,
plugins: 'gridfilters',
- emptyText: gettext('No data in database.'),
+ emptyText: gettext('No data in database'),
viewConfig: {
- deferEmptyText: false
+ deferEmptyText: false,
},
- tbar: [ { xtype: 'pmgStatTimeSelector' } ],
+ tbar: [{ xtype: 'pmgStatTimeSelector' }],
store: {
type: 'pmgStatStore',
proxy: {
type: 'pmgfilterproxy',
sortParam: 'orderby',
- filterId: 'x-gridfilter-contact'
+ filterId: 'x-gridfilter-contact',
},
sorters: [
{
property: 'count',
- direction: 'DESC'
+ direction: 'DESC',
},
{
property: 'bytes',
- direction: 'DESC'
+ direction: 'DESC',
},
{
property: 'contact',
- direction: 'ASC'
- }
- ]
+ direction: 'ASC',
+ },
+ ],
},
columns: [
type: 'string',
itemDefaults: {
// any Ext.form.field.Text configs accepted
- }
- }
+ },
+ },
},
{
text: gettext('Count'),
columns: [
{
text: gettext('Mail'),
- dataIndex: 'count'
+ dataIndex: 'count',
},
{
header: gettext('Virus'),
- dataIndex: 'viruscount'
- }
- ]
+ dataIndex: 'viruscount',
+ },
+ ],
},
{
text: gettext('Size') + ' (KB)',
dataIndex: 'bytes',
renderer: function(v) {
return Ext.Number.toFixed(v/1024, 0);
- }
- }
+ },
+ },
],
initComponent: function() {
me.callParent();
Proxmox.Utils.monStoreErrors(me, me.store, true);
- }
+ },
});
Ext.define('PMG.ContactStatistics', {
xclass: 'Ext.app.ViewController',
selectionChange: function(grid, selected, eOpts) {
- var details = this.lookupReference('details');
+ var details = this.lookupReference('details');
if (selected.length > 0) {
var contact = selected[0].data.contact;
var url = "/api2/json/statistics/contact/" +
} else {
details.setUrl();
}
- }
+ },
},
items: [
region: 'east',
reference: 'details',
split: true,
- flex: 1
- }
- ]
+ flex: 1,
+ },
+ ],
});