]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/Utils.js
improve rule GUI
[pmg-gui.git] / js / Utils.js
index 813998d0034429c7de726a47649fc1438c3cf678..f1ec382df6056178aa1e37508151b8ac6ca18684 100644 (file)
@@ -5,7 +5,7 @@ console.log("Starting PMG Manager");
 
 Ext.define('PMG.Utils', {
     singleton: true,
+
     // this singleton contains miscellaneous utilities
 
     senderText: gettext('Sender'),
@@ -17,7 +17,17 @@ Ext.define('PMG.Utils', {
        when: gettext('When Objects'),
        action: gettext('Action Objects')
     },
-    
+
+    rule_direction_text: {
+       0: gettext('In'),
+       1: gettext('Out'),
+       2: gettext('In & Out')
+    },
+
+    format_rule_direction: function(dir) {
+       return PMG.Utils.rule_direction_text[dir] || dir;
+    },
+
     format_otype: function(otype) {
        var editor = PMG.Utils.object_editors[otype];
        if (editor) {
@@ -178,7 +188,7 @@ Ext.define('PMG.Utils', {
 
        }
     },
-                         
+
     constructor: function() {
        var me = this;