[pve-devel] [PATCH V2 manager 2/3] cleanup: "var" to "let", fix some indentation in related files

Stefan Hrdlicka s.hrdlicka at proxmox.com
Wed Jun 22 16:39:28 CEST 2022


replace all "var" with "let" in files related to patch for ticket 2822

Signed-off-by: Stefan Hrdlicka <s.hrdlicka at proxmox.com>
---
 www/manager6/storage/Base.js        | 10 +++++-----
 www/manager6/storage/IScsiEdit.js   |  6 +++---
 www/manager6/storage/LVMEdit.js     | 14 +++++++-------
 www/manager6/storage/LvmThinEdit.js | 18 +++++++++---------
 www/manager6/storage/ZFSPoolEdit.js | 23 +++++++++++------------
 5 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
index bb497a5f..d55bbbc6 100644
--- a/www/manager6/storage/Base.js
+++ b/www/manager6/storage/Base.js
@@ -5,7 +5,7 @@ Ext.define('PVE.panel.StorageBase', {
     type: '',
 
     onGetValues: function(values) {
-	var me = this;
+	let me = this;
 
 	if (me.isCreate) {
 	    values.type = me.type;
@@ -20,7 +20,7 @@ Ext.define('PVE.panel.StorageBase', {
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.column1.unshift({
 	    xtype: me.isCreate ? 'textfield' : 'displayfield',
@@ -129,7 +129,7 @@ Ext.define('PVE.storage.BaseEdit', {
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.isCreate = !me.storageId;
 
@@ -189,8 +189,8 @@ Ext.define('PVE.storage.BaseEdit', {
 	if (!me.isCreate) {
 	    me.load({
 		success: function(response, options) {
-		    var values = response.result.data;
-		    var ctypes = values.content || '';
+		    let values = response.result.data;
+		    let ctypes = values.content || '';
 
 		    values.content = ctypes.split(',');
 
diff --git a/www/manager6/storage/IScsiEdit.js b/www/manager6/storage/IScsiEdit.js
index c121273b..4b34bb9a 100644
--- a/www/manager6/storage/IScsiEdit.js
+++ b/www/manager6/storage/IScsiEdit.js
@@ -64,7 +64,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
     onlineHelp: 'storage_open_iscsi',
 
     onGetValues: function(values) {
-	var me = this;
+	let me = this;
 
 	values.content = values.luns ? 'images' : 'none';
 	delete values.luns;
@@ -78,7 +78,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.column1 = [];
 	let target = null;
@@ -122,7 +122,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
 		listeners: {
 		    change: function(f, value) {
 			if (me.isCreate) {
-			    var exportField = me.down('field[name=target]');
+			    let exportField = me.down('field[name=target]');
 			    exportField.setPortal(value);
 			    exportField.setValue('');
 			}
diff --git a/www/manager6/storage/LVMEdit.js b/www/manager6/storage/LVMEdit.js
index a58982e9..c5765ff0 100644
--- a/www/manager6/storage/LVMEdit.js
+++ b/www/manager6/storage/LVMEdit.js
@@ -9,13 +9,13 @@ Ext.define('PVE.storage.VgSelector', {
 	apiStoragePath: '/scan/lvm',
     },
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	if (!me.nodename) {
 	    me.nodename = 'localhost';
 	}
 
-	var store = Ext.create('Ext.data.Store', {
+	let store = Ext.create('Ext.data.Store', {
 	    autoLoad: {}, // true,
 	    fields: ['vg', 'size', 'free'],
 	    proxy: {
@@ -48,9 +48,9 @@ Ext.define('PVE.storage.BaseStorageSelector', {
     valueField: 'storage',
     displayField: 'text',
     initComponent: function() {
-	var me = this;
+	let me = this;
 
-	var store = Ext.create('Ext.data.Store', {
+	let store = Ext.create('Ext.data.Store', {
 	    autoLoad: {
 		addRecords: true,
 		params: {
@@ -92,11 +92,11 @@ Ext.define('PVE.storage.LVMInputPanel', {
     onlineHelp: 'storage_lvm',
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.column1 = [];
 
-	var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
+	let vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
 	    name: 'vgname',
 	    hidden: !!me.isCreate,
 	    disabled: !!me.isCreate,
@@ -124,7 +124,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
 
 	    me.column1.push(pveScanNodeSelector);
 
-	    var baseField = Ext.createWidget('pveFileSelector', {
+	    let baseField = Ext.createWidget('pveFileSelector', {
 		name: 'base',
 		hidden: true,
 		disabled: true,
diff --git a/www/manager6/storage/LvmThinEdit.js b/www/manager6/storage/LvmThinEdit.js
index da72dac7..28ff26d8 100644
--- a/www/manager6/storage/LvmThinEdit.js
+++ b/www/manager6/storage/LvmThinEdit.js
@@ -16,7 +16,7 @@ Ext.define('PVE.storage.TPoolSelector', {
     },
 
     onTriggerClick: function() {
-	var me = this;
+	let me = this;
 
 	if (!me.queryCaching || me.lastQuery !== me.vg) {
 	    me.store.removeAll();
@@ -28,19 +28,19 @@ Ext.define('PVE.storage.TPoolSelector', {
     },
 
     setVG: function(myvg) {
-	var me = this;
+	let me = this;
 
 	me.vg = myvg;
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	if (!me.nodename) {
 	    me.nodename = 'localhost';
 	}
 
-	var store = Ext.create('Ext.data.Store', {
+	let store = Ext.create('Ext.data.Store', {
 	    fields: ['lv'],
 	    proxy: {
 		type: 'proxmox',
@@ -73,13 +73,13 @@ Ext.define('PVE.storage.BaseVGSelector', {
 	apiStoragePath: '/scan/lvm',
     },
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	if (!me.nodename) {
 	    me.nodename = 'localhost';
 	}
 
-	var store = Ext.create('Ext.data.Store', {
+	let store = Ext.create('Ext.data.Store', {
 	    autoLoad: {},
 	    fields: ['vg', 'size', 'free'],
 	    proxy: {
@@ -105,11 +105,11 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
     onlineHelp: 'storage_lvmthin',
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.column1 = [];
 
-	var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
+	let vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
 	    name: 'vgname',
 	    hidden: !!me.isCreate,
 	    disabled: !!me.isCreate,
@@ -118,7 +118,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
 	    allowBlank: false,
 	});
 
-	var thinpoolField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
+	let thinpoolField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
 	    name: 'thinpool',
 	    hidden: !!me.isCreate,
 	    disabled: !!me.isCreate,
diff --git a/www/manager6/storage/ZFSPoolEdit.js b/www/manager6/storage/ZFSPoolEdit.js
index c274d84a..1037d752 100644
--- a/www/manager6/storage/ZFSPoolEdit.js
+++ b/www/manager6/storage/ZFSPoolEdit.js
@@ -12,13 +12,13 @@ Ext.define('PVE.storage.ZFSPoolSelector', {
 	apiStoragePath: '/scan/zfs',
     },
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	if (!me.nodename) {
 	    me.nodename = 'localhost';
 	}
 
-	var store = Ext.create('Ext.data.Store', {
+	let store = Ext.create('Ext.data.Store', {
 	    autoLoad: {}, // true,
 	    fields: ['pool', 'size', 'free'],
 	    proxy: {
@@ -42,7 +42,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
     onlineHelp: 'storage_zfspool',
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.column1 = [];
 
@@ -75,15 +75,14 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
 
 	// value is an array,
 	// while before it was a string
-	me.column1.push(
-	    {
-xtype: 'pveContentTypeSelector',
-	     cts: ['images', 'rootdir'],
-	     fieldLabel: gettext('Content'),
-	     name: 'content',
-	     value: ['images', 'rootdir'],
-	     multiSelect: true,
-	     allowBlank: false,
+	me.column1.push({
+	    xtype: 'pveContentTypeSelector',
+	    cts: ['images', 'rootdir'],
+	    fieldLabel: gettext('Content'),
+	    name: 'content',
+	    value: ['images', 'rootdir'],
+	    multiSelect: true,
+	    allowBlank: false,
 	});
 	me.column2 = [
 	    {
-- 
2.30.2






More information about the pve-devel mailing list