pmg-gui/js/SpamScoreDistribution.js
Dominik Csapak de0ebd99a1 jslint: type confusion
resolve/mark several type confusions

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-23 17:30:26 +02:00

55 lines
1.0 KiB
JavaScript

Ext.define('PMG.SpamScoreDistribution', {
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamScoreDistribution',
disableSelection: true,
border: false,
title: gettext('Statistics') + ': ' + 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.toString();
}
}
}
]
},
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")}%' ]
}
}
]
});