]>
git.proxmox.com Git - pmg-gui.git/blob - js/SpamInfoGrid.js
1 Ext
.define('PMG.grid.SpamInfoGrid', {
2 extend
: 'Ext.grid.GridPanel',
3 xtype
: 'pmgSpamInfoGrid',
7 fields
: ['desc', 'name', { type
: 'number', name
: 'score' }],
10 root
: 'data.spaminfo',
15 setID: function(rec
) {
17 let id
= rec
?.data
?.id
;
19 me
.getStore().removeAll();
22 me
.store
.proxy
.setUrl(`/api2/json/quarantine/content?id=${id}`);
26 emptyText
: gettext('No Spam Info'),
35 text
: gettext('Test Name'),
39 summaryRenderer
: _v
=> gettext('Spamscore'),
40 tdCls
: 'txt-monospace',
43 text
: gettext('Score'),
46 tdCls
: 'txt-monospace',
47 renderer: function(score
, metaData
) {
51 let absScore
= Math
.abs(score
);
52 let fontWeight
= '400', background
= score
< 0 ? '#d7e9f6' : '#f3d6d7';
55 background
= score
< 0 ? '#ACD1EC' : '#E8B0B2';
56 } else if (absScore
>= 1.5) {
58 } else if (absScore
<= 0.1) {
60 background
= score
< 0 ? '#EEF6FB' : '#FAEFF0';
62 metaData
.tdStyle
= `font-weight: ${fontWeight};background-color: ${background};`;
66 summaryRenderer
: value
=> Ext
.util
.Format
.round(value
, 5),
69 text
: gettext('Description'),