]> git.proxmox.com Git - pmg-gui.git/blob - js/SpamInfoGrid.js
quarantine: use new controller for virus and attachment quarantines
[pmg-gui.git] / js / SpamInfoGrid.js
1 Ext.define('PMG.grid.SpamInfoGrid', {
2 extend: 'Ext.grid.GridPanel',
3 xtype: 'pmgSpamInfoGrid',
4
5 hideHeaders: true,
6
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
16 setID: function(rec) {
17 var me = this;
18 if (!rec || !rec.data || !rec.data.id) {
19 me.getStore().removeAll();
20 return;
21 }
22 var url = '/api2/json/quarantine/content?id=' + rec.data.id;
23 me.store.proxy.setUrl(url);
24 me.store.load();
25 },
26
27 emptyText: gettext('No Spam Info'),
28 hidden: true,
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 },
58 ],
59 });