pmg-gui/js/SpamInfoGrid.js
Dominik Csapak 4700c0375b hide column headers for spam level info
they dont give any useful information

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-09-29 09:42:59 +02:00

60 lines
1.2 KiB
JavaScript

Ext.define('PMG.grid.SpamInfoGrid',{
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamInfoGrid',
hideHeaders: true,
store: {
autoDestroy: true,
fields: [ 'desc', 'name', { type: 'number', name: 'score' } ],
proxy: {
type: 'proxmox',
root: 'data.spaminfo'
}
},
setID: function(rec) {
var me = this;
if (!rec || !rec.data || !rec.data.id) {
me.getStore().removeAll();
return;
}
var url = '/api2/json/quarantine/content?id=' + rec.data.id;
me.store.proxy.setUrl(url);
me.store.load();
},
emptyText: gettext('No Spam Info'),
hidden: true,
features: [{
ftype: 'summary'
}],
columns: [
{
text: gettext('Test Name'),
dataIndex: 'name',
flex: 2,
summaryType: 'count',
summaryRenderer: function(value, summaryData, dataIndex, metaData) {
return gettext('Spamscore');
}
},
{
text: gettext('Score'),
dataIndex: 'score',
align: 'right',
summaryType: 'sum',
summaryRenderer: function(value, summaryData, dataIndex, metaData) {
return Ext.util.Format.round(value, 5);
}
},
{
text: gettext('Description'),
dataIndex: 'desc',
flex: 3
}
],
});