mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-06-06 09:29:35 +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'),
|
senderText: gettext('Sender'),
|
||||||
receiverText: gettext('Receiver'),
|
receiverText: gettext('Receiver'),
|
||||||
|
scoreText: gettext('Score'),
|
||||||
|
|
||||||
oclass_text: {
|
oclass_text: {
|
||||||
who: gettext('Who Objects'),
|
who: gettext('Who Objects'),
|
||||||
|
Loading…
Reference in New Issue
Block a user