]>
Commit | Line | Data |
---|---|---|
ad88af09 DM |
1 | Ext.define('PMG.SpamScoreDistribution', { |
2 | extend: 'Ext.grid.GridPanel', | |
3 | xtype: 'pmgSpamScoreDistribution', | |
4 | ||
5 | disableSelection: true, | |
50531ef9 | 6 | border: false, |
ad88af09 | 7 | |
3755c9e0 | 8 | title: gettext('Statistics') + ': ' + gettext('Spam Scores'), |
ad88af09 | 9 | |
c87d46fb | 10 | tbar: [{ xtype: 'pmgStatTimeSelector' }], |
ad88af09 DM |
11 | |
12 | store: { | |
13 | xclass: 'PMG.data.StatStore', | |
14 | staturl: "/api2/json/statistics/spamscores", | |
15 | fields: [ | |
16 | 'count', 'ratio', | |
17 | { | |
18 | type: 'string', | |
19 | name: 'label', | |
20 | convert: function(v, rec) { | |
21 | if (rec.data.level >= 10) { | |
22 | return PMG.Utils.scoreText + ' >= 10'; | |
23 | } else { | |
de0ebd99 | 24 | return PMG.Utils.scoreText + ' ' + rec.data.level.toString(); |
ad88af09 | 25 | } |
c87d46fb TL |
26 | }, |
27 | }, | |
28 | ], | |
ad88af09 DM |
29 | }, |
30 | ||
31 | columns: [ | |
32 | { | |
33 | header: PMG.Utils.scoreText, | |
34 | flex: 1, | |
c87d46fb | 35 | dataIndex: 'label', |
ad88af09 DM |
36 | }, |
37 | { | |
38 | header: gettext("Count"), | |
39 | width: 150, | |
c87d46fb | 40 | dataIndex: 'count', |
ad88af09 DM |
41 | }, |
42 | { | |
43 | header: gettext("Percentage"), | |
44 | width: 300, | |
45 | ||
46 | xtype: 'widgetcolumn', | |
47 | dataIndex: 'ratio', | |
48 | widget: { | |
49 | xtype: 'progressbarwidget', | |
c87d46fb TL |
50 | textTpl: ['{percent:number("0")}%'], |
51 | }, | |
52 | }, | |
53 | ], | |
ad88af09 | 54 | }); |