]> git.proxmox.com Git - pmg-gui.git/commitdiff
utils: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Feb 2022 08:35:46 +0000 (09:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Feb 2022 08:35:46 +0000 (09:35 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/Utils.js

index f6daf1592ac7c7aabc18ae9e4202ec7208c9b9d6..8c0dc8c9cd35003db6a60e1ed74c20596640bbcf 100644 (file)
@@ -129,14 +129,12 @@ Ext.define('PMG.Utils', {
     },
 
     format_otype: function(otype) {
-       var editor = PMG.Utils.object_editors[otype];
-       var iconCls = 'fa fa-question-circle';
+       let editor = PMG.Utils.object_editors[otype];
+       let iconCls = 'fa fa-question-circle';
        if (editor) {
-           var icon = '<span class="fa-fw ' + (editor.iconCls || iconCls) + '"></span> ';
-           return icon + editor.subject;
+           return `<span class="fa-fw ${editor.iconCls || iconCls}"></span> ${editor.subject}`;
        }
-
-       return '<span class="fa-fw ' + iconCls + '"></span> unknown';
+       return `<span class="fa-fw ${iconCls}"></span> unknown`;
     },
 
     format_ldap_protocol: function(p) {
@@ -148,7 +146,7 @@ Ext.define('PMG.Utils', {
     },
 
     convert_field_to_per_min: function(value, record) {
-       return value/(record.data.timespan/60);
+       return value / (record.data.timespan / 60);
     },
 
     object_editors: {
@@ -168,9 +166,9 @@ Ext.define('PMG.Utils', {
                    fieldLabel: gettext("Regular Expression"),
                },
                {
-                   labelWidth: 150,
-                   fieldLabel: gettext('Test String'),
                    xtype: 'pmgRegexTester',
+                   fieldLabel: gettext('Test String'),
+                   labelWidth: 150,
                    wholeMatch: true,
                    regexFieldReference: 'regex',
                },