]> git.proxmox.com Git - pmg-gui.git/blame - js/SpamInfoGrid.js
StatTimeSelector: don't show invalid month/day combinations
[pmg-gui.git] / js / SpamInfoGrid.js
CommitLineData
c87d46fb 1Ext.define('PMG.grid.SpamInfoGrid', {
79a3f18d
DC
2 extend: 'Ext.grid.GridPanel',
3 xtype: 'pmgSpamInfoGrid',
4
4700c037
DC
5 hideHeaders: true,
6
c8114985
DM
7 store: {
8 autoDestroy: true,
c87d46fb 9 fields: ['desc', 'name', { type: 'number', name: 'score' }],
c8114985
DM
10 proxy: {
11 type: 'proxmox',
c87d46fb
TL
12 root: 'data.spaminfo',
13 },
c8114985
DM
14 },
15
79a3f18d
DC
16 setID: function(rec) {
17 var me = this;
18 if (!rec || !rec.data || !rec.data.id) {
19 me.getStore().removeAll();
20 return;
21 }
c8114985
DM
22 var url = '/api2/json/quarantine/content?id=' + rec.data.id;
23 me.store.proxy.setUrl(url);
24 me.store.load();
79a3f18d
DC
25 },
26
27 emptyText: gettext('No Spam Info'),
28 hidden: true,
79a3f18d
DC
29
30 features: [{
c87d46fb 31 ftype: 'summary',
79a3f18d
DC
32 }],
33
34 columns: [
35 {
36 text: gettext('Test Name'),
37 dataIndex: 'name',
38 flex: 2,
39 summaryType: 'count',
40 summaryRenderer: function(value, summaryData, dataIndex, metaData) {
41 return gettext('Spamscore');
c87d46fb 42 },
79a3f18d
DC
43 },
44 {
45 text: gettext('Score'),
46 dataIndex: 'score',
47 align: 'right',
48 summaryType: 'sum',
49 summaryRenderer: function(value, summaryData, dataIndex, metaData) {
50 return Ext.util.Format.round(value, 5);
c87d46fb 51 },
79a3f18d
DC
52 },
53 {
54 text: gettext('Description'),
55 dataIndex: 'desc',
c87d46fb
TL
56 flex: 3,
57 },
58 ],
79a3f18d 59});