[pve-devel] [PATCH 04/18] improve rule_direction formatter

Dominik Csapak d.csapak at proxmox.com
Tue Apr 4 13:48:44 CEST 2017


this adds arrow icons to the direction formatter

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/Utils.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/js/Utils.js b/js/Utils.js
index d9d6b8e..edbe0b1 100644
--- a/js/Utils.js
+++ b/js/Utils.js
@@ -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) {
-- 
2.11.0





More information about the pve-devel mailing list