]> git.proxmox.com Git - pmg-gui.git/commitdiff
add colors and icons to trackingcenter
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 5 Oct 2017 10:28:03 +0000 (12:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Oct 2017 10:56:56 +0000 (12:56 +0200)
add icons for all of the stati,
and background colors for bounced/quarantine/blocked

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/MailTracker.js

index 6e3d77e49d4a419e9a2bb1fdd59245d48016295a..ea544e226567b47e9fc40d2ca58f56fb65b2b419 100644 (file)
@@ -207,6 +207,10 @@ Ext.define('PMG.MailTracker', {
     viewConfig: {
        deferEmptyText: false,
        enableTextSelection: true,
+       getRowClass: function(record, index) {
+           var status = record.data.rstatus || record.data.dstatus;
+           return PMG.Utils.mail_status_map[status];
+       }
     },
 
     plugins: [
@@ -317,19 +321,24 @@ Ext.define('PMG.MailTracker', {
            header: gettext('Status'),
            width: 150,
            renderer: function(v, metaData, rec) {
+               var returntext = 'unknown';
+               var icon = 'question-circle';
                var rstatus = rec.data.rstatus;
                if (v !== undefined && v !== '') {
                    vtext = PMG.Utils.mail_status_map[v] || v;
+                   icon = v;
                    if (rstatus !== undefined && rstatus !== '') {
                        rtext = PMG.Utils.mail_status_map[rstatus] || rstatus;
-                       return vtext + '/' + rtext;
-                   }
-                   if (rec.data.qid !== undefined) {
-                       return 'queued/' + vtext;
+                       returntext = vtext + '/' + rtext;
+                       icon = rstatus;
+                   } else if (rec.data.qid !== undefined) {
+                       returntext = 'queued/' + vtext;
+                   } else {
+                       returntext = vtext;
                    }
-                   return vtext;
                }
-               return 'unknown';
+
+               return PMG.Utils.format_status_icon(icon) + returntext;
            },
            dataIndex: 'dstatus'
        },