]> git.proxmox.com Git - pmg-gui.git/commitdiff
add status icons to utils
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 5 Oct 2017 10:28:01 +0000 (12:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Oct 2017 10:56:20 +0000 (12:56 +0200)
used later for the tracking center

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

index 1611ca3c4bbe8695c306a66764a9f7e422bf7040..fb84685dc1879e1809ba2eb2c50906fbb4dac778 100644 (file)
@@ -42,6 +42,43 @@ Ext.define('PMG.Utils', {
        Q: 'quarantine'
     },
 
+    icon_status_map: {
+       2: {
+           fa: 'check-circle',
+           color: 'green'
+       },
+       4: {
+           fa: 'clock-o',
+       },
+       5: {
+           fa: 'mail-reply',
+           color: 'gray'
+       },
+       N: {
+           fa: 'times-circle'
+       },
+       G: {
+           fa: 'list'
+       },
+       A: {
+           fa: 'check',
+           color: 'green'
+       },
+       B: {
+           fa: 'ban',
+           color: 'red'
+       },
+       Q: {
+           fa: 'cube'
+       }
+    },
+
+    format_status_icon: function(status) {
+       var icon = PMG.Utils.icon_status_map[status] || {};
+       return '<i class="fa fa-' + (icon.fa || 'question-circle') + ' ' +
+              (icon.color || '') + '"></i> ';
+    },
+
     format_oclass: function(oclass) {
        var icon = PMG.Utils.oclass_icon[oclass] || '';
        var text = PMG.Utils.oclass_text[oclass] || oclass;