]> git.proxmox.com Git - pmg-gui.git/blob - js/SpamScoreDistribution.js
ui: node summary: use SI units for HD usage
[pmg-gui.git] / js / SpamScoreDistribution.js
1 Ext.define('PMG.SpamScoreDistribution', {
2 extend: 'Ext.grid.GridPanel',
3 xtype: 'pmgSpamScoreDistribution',
4
5 disableSelection: true,
6 border: false,
7
8 title: gettext('Statistics') + ': ' + gettext('Spam Scores'),
9
10 tbar: [{ xtype: 'pmgStatTimeSelector' }],
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 {
24 return PMG.Utils.scoreText + ' ' + rec.data.level.toString();
25 }
26 },
27 },
28 ],
29 },
30
31 columns: [
32 {
33 header: PMG.Utils.scoreText,
34 flex: 1,
35 dataIndex: 'label',
36 },
37 {
38 header: gettext("Count"),
39 width: 150,
40 dataIndex: 'count',
41 },
42 {
43 header: gettext("Percentage"),
44 width: 300,
45
46 xtype: 'widgetcolumn',
47 dataIndex: 'ratio',
48 widget: {
49 xtype: 'progressbarwidget',
50 textTpl: ['{percent:number("0")}%'],
51 },
52 },
53 ],
54 });