pmg-gui/js/SpamInfoGrid.js
Dominik Csapak 79a3f18d31 add SpamInfoGrid component
this component will be used to show the Spam info in the quarantine
in a nice tabular format

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-09-28 14:43:49 +02:00

58 lines
1.1 KiB
JavaScript

Ext.define('PMG.grid.SpamInfoGrid',{
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamInfoGrid',
setID: function(rec) {
var me = this;
if (!rec || !rec.data || !rec.data.id) {
me.getStore().removeAll();
return;
}
me.setStore({
autoLoad: true,
autoDestroy: true,
proxy: {
type: 'proxmox',
url: '/api2/json/quarantine/content?id='+rec.data.id,
root: 'data.spaminfo'
}
});
},
emptyText: gettext('No Spam Info'),
hidden: true,
border: true,
bodyBorder: false,
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
}
],
});