mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-06-03 18:01:22 +00:00

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>
58 lines
1.1 KiB
JavaScript
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
|
|
}
|
|
],
|
|
});
|