]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/storage/IScsiEdit.js
ui: eslint: enforce "no-unneeded-ternary" rule
[pve-manager.git] / www / manager6 / storage / IScsiEdit.js
index 33a198dd8c768a9a44ec39d655454a9cbe09bae6..4cb6bec57c81b723722a2e6e59c15c677aa284c7 100644 (file)
@@ -8,7 +8,7 @@ Ext.define('PVE.storage.IScsiScan', {
     matchFieldWidth: false,
     listConfig: {
        loadingText: gettext('Scanning...'),
-       width: 350
+       width: 350,
     },
     doRawQuery: function() {
     },
@@ -31,7 +31,7 @@ Ext.define('PVE.storage.IScsiScan', {
        me.portal = portal;
     },
 
-    initComponent : function() {
+    initComponent: function() {
        var me = this;
 
        if (!me.nodename) {
@@ -39,26 +39,28 @@ Ext.define('PVE.storage.IScsiScan', {
        }
 
        var store = Ext.create('Ext.data.Store', {
-           fields: [ 'target', 'portal' ],
+           fields: ['target', 'portal'],
            proxy: {
                type: 'proxmox',
-               url: '/api2/json/nodes/' + me.nodename + '/scan/iscsi'
-           }
+               url: '/api2/json/nodes/' + me.nodename + '/scan/iscsi',
+           },
        });
 
        store.sort('target', 'ASC');
 
        Ext.apply(me, {
-           store: store
+           store: store,
        });
 
        me.callParent();
-    }
+    },
 });
 
 Ext.define('PVE.storage.IScsiInputPanel', {
     extend: 'PVE.panel.StorageBase',
 
+    onlineHelp: 'storage_open_iscsi',
+
     onGetValues: function(values) {
        var me = this;
 
@@ -69,11 +71,11 @@ Ext.define('PVE.storage.IScsiInputPanel', {
     },
 
     setValues: function(values) {
-       values.luns = (values.content === 'images') ? true : false;
-       this.callParent();
+       values.luns = (values.content.indexOf('images') !== -1);
+       this.callParent([values]);
     },
 
-    initComponent : function() {
+    initComponent: function() {
        var me = this;
 
        me.column1 = [
@@ -90,8 +92,8 @@ Ext.define('PVE.storage.IScsiInputPanel', {
                            exportField.setPortal(value);
                            exportField.setValue('');
                        }
-                   }
-               }
+                   },
+               },
            },
            {
                readOnly: !me.isCreate,
@@ -99,8 +101,8 @@ Ext.define('PVE.storage.IScsiInputPanel', {
                name: 'target',
                value: '',
                fieldLabel: 'Target',
-               allowBlank: false
-           }
+               allowBlank: false,
+           },
        ];
 
        me.column2 = [
@@ -108,10 +110,10 @@ Ext.define('PVE.storage.IScsiInputPanel', {
                xtype: 'checkbox',
                name: 'luns',
                checked: true,
-               fieldLabel: gettext('Use LUNs directly')
-           }
+               fieldLabel: gettext('Use LUNs directly'),
+           },
        ];
 
        me.callParent();
-    }
+    },
 });