mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-06-03 03:37:21 +00:00
add SpamScoreDistribution class
This commit is contained in:
parent
8067704ae1
commit
ad88af09ee
53
js/SpamScoreDistribution.js
Normal file
53
js/SpamScoreDistribution.js
Normal 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")}%' ]
|
||||
},
|
||||
}
|
||||
]
|
||||
});
|
@ -10,6 +10,7 @@ Ext.define('PMG.Utils', {
|
||||
|
||||
senderText: gettext('Sender'),
|
||||
receiverText: gettext('Receiver'),
|
||||
scoreText: gettext('Score'),
|
||||
|
||||
oclass_text: {
|
||||
who: gettext('Who Objects'),
|
||||
|
Loading…
Reference in New Issue
Block a user