add SpamScoreDistribution class

This commit is contained in:
Dietmar Maurer 2017-08-31 07:57:05 +02:00
parent 8067704ae1
commit ad88af09ee
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,53 @@
Ext.define('PMG.SpamScoreDistribution', {
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamScoreDistribution',
disableSelection: true,
title: gettext('Spam Scores'),
tbar: [ { xtype: 'pmgStatTimeSelector' } ],
store: {
xclass: 'PMG.data.StatStore',
staturl: "/api2/json/statistics/spamscores",
fields: [
'count', 'ratio',
{
type: 'string',
name: 'label',
convert: function(v, rec) {
if (rec.data.level >= 10) {
return PMG.Utils.scoreText + ' >= 10';
} else {
return PMG.Utils.scoreText + ' ' + rec.data.level;
}
}
}
],
},
columns: [
{
header: PMG.Utils.scoreText,
flex: 1,
dataIndex: 'label'
},
{
header: gettext("Count"),
width: 150,
dataIndex: 'count'
},
{
header: gettext("Percentage"),
width: 300,
xtype: 'widgetcolumn',
dataIndex: 'ratio',
widget: {
xtype: 'progressbarwidget',
textTpl: ['{percent:number("0")}%' ]
},
}
]
});

View File

@ -10,6 +10,7 @@ Ext.define('PMG.Utils', {
senderText: gettext('Sender'),
receiverText: gettext('Receiver'),
scoreText: gettext('Score'),
oclass_text: {
who: gettext('Who Objects'),