public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score
Date: Fri,  4 Nov 2022 16:04:23 +0100	[thread overview]
Message-ID: <20221104150425.124194-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221104150425.124194-1-d.csapak@proxmox.com>

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>
---
while the bug mentions that colors are problematic, there are not enough
font-weights to properly convey what we want to show here, so i added
colors with the same rationale we already used for the deliver/delete
buttons

 js/SpamInfoGrid.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/js/SpamInfoGrid.js b/js/SpamInfoGrid.js
index f7ee2b2..c9777d7 100644
--- a/js/SpamInfoGrid.js
+++ b/js/SpamInfoGrid.js
@@ -2,8 +2,6 @@ Ext.define('PMG.grid.SpamInfoGrid', {
     extend: 'Ext.grid.GridPanel',
     xtype: 'pmgSpamInfoGrid',
 
-    hideHeaders: true,
-
     store: {
 	autoDestroy: true,
 	fields: ['desc', 'name', { type: 'number', name: 'score' }],
@@ -45,6 +43,12 @@ Ext.define('PMG.grid.SpamInfoGrid', {
 	    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);
-- 
2.30.2





  parent reply	other threads:[~2022-11-04 15:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
2022-11-07  8:47   ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit Dominik Csapak
2022-11-07  8:47   ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine Dominik Csapak
2022-11-07 12:21   ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` Dominik Csapak [this message]
2022-11-07  9:56   ` [pmg-devel] applied: [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items Dominik Csapak
2022-11-07  9:57   ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel Dominik Csapak
2022-11-07  9:57   ` [pmg-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221104150425.124194-5-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal