sorting the matching spam rules, e.g. by score, makes it easier to see
which rules have more weight in determining spam.
Additionally, color code the scores with colors akin to the rationale
in commit:
365f84c ("quarantines: color code deliver and delete buttons")
(red for positive spam scores, blue for negative ones)
and increase the font-weight for large spamscore contributing rules.
i chose a different blue tone that is more muted than what we use in
'info-blue' but is different from both the 'hover' color and the
'selected' color
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamInfoGrid',
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamInfoGrid',
store: {
autoDestroy: true,
fields: ['desc', 'name', { type: 'number', name: 'score' }],
store: {
autoDestroy: true,
fields: ['desc', 'name', { type: 'number', name: 'score' }],
text: gettext('Score'),
dataIndex: 'score',
align: 'right',
text: gettext('Score'),
dataIndex: 'score',
align: 'right',
+ renderer: function(value, metaData) {
+ let color = value < 0 ? '#d7e9f6' : value > 0 ? '#f3d6d7' : '';
+ let fontWeight = value >= 3 ? '1000' : value >= 1.5 ? '600' : '';
+ metaData.tdStyle = `background-color: ${color}; font-weight: ${fontWeight};`;
+ return value;
+ },
summaryType: 'sum',
summaryRenderer: function(value, summaryData, dataIndex, metaData) {
return Ext.util.Format.round(value, 5);
summaryType: 'sum',
summaryRenderer: function(value, summaryData, dataIndex, metaData) {
return Ext.util.Format.round(value, 5);