]> git.proxmox.com Git - pmg-gui.git/blame - js/SpamInfoGrid.js
bump version to 1.0-26
[pmg-gui.git] / js / SpamInfoGrid.js
CommitLineData
79a3f18d
DC
1Ext.define('PMG.grid.SpamInfoGrid',{
2 extend: 'Ext.grid.GridPanel',
3 xtype: 'pmgSpamInfoGrid',
4
4700c037
DC
5 hideHeaders: true,
6
c8114985
DM
7 store: {
8 autoDestroy: true,
9 fields: [ 'desc', 'name', { type: 'number', name: 'score' } ],
10 proxy: {
11 type: 'proxmox',
12 root: 'data.spaminfo'
13 }
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: [{
31 ftype: 'summary'
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');
42 }
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);
51 }
52 },
53 {
54 text: gettext('Description'),
55 dataIndex: 'desc',
56 flex: 3
57 }
771bd0b9 58 ]
79a3f18d 59});