]> git.proxmox.com Git - pmg-gui.git/commitdiff
improve rule_direction formatter
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 4 Apr 2017 11:48:44 +0000 (13:48 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 5 Apr 2017 04:37:24 +0000 (06:37 +0200)
this adds arrow icons to the direction formatter

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

index d9d6b8e975f8642b203f8480d2f780da28a60176..edbe0b101ff14612925d5b298efc6b78abe985ef 100644 (file)
@@ -41,8 +41,16 @@ Ext.define('PMG.Utils', {
        2: gettext('In & Out')
     },
 
+    rule_direction_icon: {
+       0: '<span class="x-fa fa-fw fa-long-arrow-left"></span> ',
+       1: '<span class="x-fa fa-fw fa-long-arrow-right"></span> ',
+       2: '<span class="x-fa fa-fw fa-exchange"></span> '
+    },
+
     format_rule_direction: function(dir) {
-       return PMG.Utils.rule_direction_text[dir] || dir;
+       var icon = PMG.Utils.rule_direction_icon[dir] || '';
+       var text = PMG.Utils.rule_direction_text[dir] || dir;
+       return icon + text;
     },
 
     format_otype: function(otype) {