]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: sdn browser: code cleanup/modernization
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Jan 2023 12:51:38 +0000 (13:51 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Jan 2023 12:51:39 +0000 (13:51 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/sdn/Browser.js

index bb30cbe0f6af8fa2ee69b8e25acc00d7356d771b..09b0c4fe566c16c6f3d4dde51d8158fb11f9158a 100644 (file)
@@ -5,28 +5,26 @@ Ext.define('PVE.sdn.Browser', {
     onlineHelp: 'chapter_pvesdn',
 
     initComponent: function() {
-       var me = this;
+       let me = this;
 
-       var nodename = me.pveSelNode.data.node;
+       let nodename = me.pveSelNode.data.node;
        if (!nodename) {
            throw "no node name specified";
        }
-
-       var sdnid = me.pveSelNode.data.sdn;
-       if (!sdnid) {
+       let sdnId = me.pveSelNode.data.sdn;
+       if (!sdnId) {
            throw "no sdn ID specified";
        }
 
        me.items = [];
 
-       var caps = Ext.state.Manager.get('GuiCap');
-
        Ext.apply(me, {
-           title: Ext.String.format(gettext("Zone {0} on node {1}"),
-                                    "'" + sdnid + "'", "'" + nodename + "'"),
+           title: Ext.String.format(gettext("Zone {0} on node {1}"), `'${sdnId}'`, `'${nodename}'`),
            hstateid: 'sdntab',
        });
 
+       const caps = Ext.state.Manager.get('GuiCap');
+
        if (caps.sdn['SDN.Audit']) {
            me.items.push({
                xtype: 'pveSDNZoneContentView',
@@ -35,14 +33,13 @@ Ext.define('PVE.sdn.Browser', {
                itemId: 'content',
            });
        }
-
        if (caps.sdn['Permissions.Modify']) {
            me.items.push({
                xtype: 'pveACLView',
                title: gettext('Permissions'),
                iconCls: 'fa fa-unlock',
                itemId: 'permissions',
-               path: '/sdn/zones/' + sdnid,
+               path: `/sdn/zones/${sdnId}`,
            });
        }