[pve-devel] [PATCH manager 02/10] jslint: fix type confusion and property access

Dominik Csapak d.csapak at proxmox.com
Fri Apr 29 12:06:27 CEST 2016


fix various type confusion, for example:
items: {} and items: []
style: string and style: {}

also fix object['property'] access with
object.property

also fix /=/ with either '=' or /\=/ where appropriate
(/=/ can be confused with /= according to jslint)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Parser.js                      | 26 +++++++++++++++-----------
 www/manager6/Toolkit.js                     |  3 ++-
 www/manager6/Workspace.js                   |  3 +++
 www/manager6/button/Split.js                |  3 +++
 www/manager6/ceph/Disks.js                  |  2 +-
 www/manager6/ceph/Pool.js                   |  3 +++
 www/manager6/dc/AuthEdit.js                 |  3 +++
 www/manager6/form/HotplugFeatureSelector.js |  8 +++++---
 www/manager6/grid/PoolMembers.js            |  3 +++
 www/manager6/lxc/Config.js                  |  4 ++--
 www/manager6/lxc/DNS.js                     |  2 +-
 www/manager6/lxc/Network.js                 | 13 ++++++++++---
 www/manager6/lxc/Summary.js                 |  2 +-
 www/manager6/node/Subscription.js           |  2 +-
 www/manager6/panel/ConfigPanel.js           | 10 +++++-----
 www/manager6/panel/LogView.js               |  2 +-
 www/manager6/panel/RRDChart.js              |  2 +-
 www/manager6/qemu/BootOrderEdit.js          |  8 ++++----
 www/manager6/qemu/CPUOptions.js             |  8 ++++----
 www/manager6/qemu/MemoryEdit.js             |  2 +-
 www/manager6/qemu/ProcessorEdit.js          | 14 +++++++-------
 www/manager6/storage/LVMEdit.js             |  4 ++++
 www/manager6/storage/LvmThinEdit.js         |  4 ++++
 www/manager6/storage/RBDEdit.js             |  4 ++++
 www/manager6/storage/Summary.js             |  2 +-
 www/manager6/storage/ZFSPoolEdit.js         |  8 ++++++--
 www/manager6/tree/ResourceTree.js           |  4 ++--
 www/manager6/window/SafeDestroy.js          |  2 +-
 28 files changed, 98 insertions(+), 53 deletions(-)

diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js
index 3f15d8f..ae8bff9 100644
--- a/www/manager6/Parser.js
+++ b/www/manager6/Parser.js
@@ -10,7 +10,7 @@ Ext.define('PVE.Parser', { statics: {
 	    return default_value;
 	}
 	value = value.toLowerCase();
-	return value === 1 || value === '1' ||
+	return value === '1' ||
 	       value === 'on' ||
 	       value === 'yes' ||
 	       value === 'true';
@@ -192,9 +192,11 @@ Ext.define('PVE.Parser', { statics: {
 			errors = true;
 			return false; // break
 		    }
-		    data['bridge'] = bridge_res[1];
-		    data['tag'] = bridge_res[4];
-		    data['firewall'] = bridge_res[5] ? 1 : 0;
+		    data.bridge = bridge_res[1];
+		    data.tag = bridge_res[4];
+		    /*jslint confusion: true*/
+		    data.firewall = bridge_res[5] ? 1 : 0;
+		    /*jslint confusion: false*/
 		} else {
 		    data[match_res[1]] = match_res[2];
 		}
@@ -221,10 +223,10 @@ Ext.define('PVE.Parser', { statics: {
 	    Ext.Array.each(['ifname', 'mac', 'bridge', 'host_ifname' , 'host_mac', 'mac_filter', 'tag', 'firewall'], function(key) {
 		var value = data[key];
 		if (key === 'bridge'){
-		    if(data['tag']){
-			value = value + 'v' + data['tag'];
+		    if(data.tag){
+			value = value + 'v' + data.tag;
 		    }
-		    if (data['firewall']){
+		    if (data.firewall){
 			value = value + 'f';
 		    }
 		}
@@ -270,9 +272,11 @@ Ext.define('PVE.Parser', { statics: {
 		}
 	});
 
+	/*jslint confusion: true*/
 	if (data.rate > 0) {
 	    tmparray.push('rate=' + data.rate);
 	}
+	/*jslint confusion: false*/
 	return tmparray.join(',');
     },
 
@@ -396,7 +400,7 @@ Ext.define('PVE.Parser', { statics: {
 	var res = {};
 
 	Ext.Array.each(value.split(','), function(p) {
-	    var kva = p.split(/=/, 2);
+	    var kva = p.split('=', 2);
 	    res[kva[0]] = kva[1];
 	});
 
@@ -419,7 +423,7 @@ Ext.define('PVE.Parser', { statics: {
 	var res = {};
 
 	Ext.Array.each(value.split(','), function(p) {
-	    var kva = p.split(/=/, 2);
+	    var kva = p.split('=', 2);
 	    res[kva[0]] = kva[1];
 	});
 
@@ -439,8 +443,8 @@ Ext.define('PVE.Parser', { statics: {
 		return; // continue
 	    }
 
-	    if (!p.match(/=/)) {
-		if (Ext.isDefined(res['cpu'])) {
+	    if (!p.match(/\=/)) {
+		if (Ext.isDefined(res.cpu)) {
 		    errors = true;
 		    return false; // break
 		}
diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index a701b8f..e3a4e23 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -147,6 +147,7 @@ Ext.define('PVE.Datepicker', {
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated
 Ext.onReady(function() {
+/*jslint confusion: true */
     Ext.override(Ext.Msg, {
 	alert: function(title, message, fn, scope) {
 	    if (Ext.isString(title)) {
@@ -163,8 +164,8 @@ Ext.onReady(function() {
 	    }
 	}
     });
+/*jslint confusion: false */
 });
-
 Ext.define('Ext.ux.IFrame', {
     extend: 'Ext.Component',
 
diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
index 685b909..fb6ce58 100644
--- a/www/manager6/Workspace.js
+++ b/www/manager6/Workspace.js
@@ -109,6 +109,9 @@ Ext.define('PVE.ConsoleWorkspace', {
     title: gettext('Console'),
 
     initComponent : function() {
+	// novnc is a string in param
+	// but a boolean in content
+	/*jslint confusion: true*/
 	var me = this;
 
 	var param = Ext.Object.fromQueryString(window.location.search);
diff --git a/www/manager6/button/Split.js b/www/manager6/button/Split.js
index 8ea65d2..6154841 100644
--- a/www/manager6/button/Split.js
+++ b/www/manager6/button/Split.js
@@ -32,9 +32,12 @@ Ext.define('PVE.button.Split', {
 
 	if (me.confirmMsg) {
 	    msg = me.confirmMsg;
+	    // confirMsg can be boolean or function
+	    /*jslint confusion: true*/
 	    if (Ext.isFunction(me.confirmMsg)) {
 		msg = me.confirmMsg(rec);
 	    }
+	    /*jslint confusion: false*/
 	    Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
 	    Ext.Msg.show({
 		title: gettext('Confirm'),
diff --git a/www/manager6/ceph/Disks.js b/www/manager6/ceph/Disks.js
index 19258fa..3c0ba37 100644
--- a/www/manager6/ceph/Disks.js
+++ b/www/manager6/ceph/Disks.js
@@ -15,7 +15,7 @@ Ext.define('PVE.node.CephDiskList', {
 	    sortable: false,
 	    renderer: function(v, metaData, rec) {
 		if (rec && (rec.data.osdid >= 0)) {
-		    return "osd." + rec.data.osdid;
+		    return "osd." + rec.data.osdid.toString();
 		}
 		return v || PVE.Utils.noText;
 	    },
diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index 845e7e5..099380f 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -1,3 +1,6 @@
+// Ext.create is a function, but
+// we defined create a bool in PVE.window.Edit
+/*jslint confusion: true*/
 Ext.define('PVE.CephCreatePool', {
     extend: 'PVE.window.Edit',
     alias: ['widget.pveCephCreatePool'],
diff --git a/www/manager6/dc/AuthEdit.js b/www/manager6/dc/AuthEdit.js
index ca305e9..de51062 100644
--- a/www/manager6/dc/AuthEdit.js
+++ b/www/manager6/dc/AuthEdit.js
@@ -274,8 +274,11 @@ Ext.define('PVE.dc.AuthEdit', {
 			    data.yubico_api_id = tfacfg.id;
 			    data.yubico_url = tfacfg.url;
 			} else if (tfacfg.type === 'oath') {
+			    // step is a number before
+			    /*jslint confusion: true*/
 			    data.oath_step = tfacfg.step;
 			    data.oath_digits = tfacfg.digits;
+			    /*jslint confusion: false*/
 			}
 		    }
 
diff --git a/www/manager6/form/HotplugFeatureSelector.js b/www/manager6/form/HotplugFeatureSelector.js
index 2277155..23cd090 100644
--- a/www/manager6/form/HotplugFeatureSelector.js
+++ b/www/manager6/form/HotplugFeatureSelector.js
@@ -15,13 +15,15 @@ Ext.define('PVE.form.HotplugFeatureSelector', {
 	var me = this;
 
 	if (me.multiSelect && Ext.isString(value)) {
+	    var newVal;
 	    if (value === '0') {
-		value = [];
+		newVal = [];
 	    } else if (value === '1') {
-		value = ['disk', 'network', 'usb'];
+		newVal = ['disk', 'network', 'usb'];
 	    } else {
-		value = value.split(',');
+		newVal = value.split(',');
 	    }
+	    me.callParent([newVal, doSelect]);
 	}
 
 	me.callParent([value, doSelect]);
diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js
index c3fdc21..63a9d5a 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -1,3 +1,6 @@
+// Ext.create is a function
+// but we defined create as a bool in PVE.window.Edit
+/*jslint confusion: true*/
 Ext.define('PVE.pool.AddVM', {
     extend: 'PVE.window.Edit',
     width: 600,
diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 5e09064..f014ffe 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -137,10 +137,10 @@ Ext.define('PVE.lxc.Config', {
 		    layout: 'fit',
 		    plugins: {
 			ptype: 'lazyitems',
-			items: {
+			items: [{
 			    xtype: 'pveLxcRessourceView',
 			    pveSelNode: me.pveSelNode
-			}
+			}]
 		    }
 		},
 		{
diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index 0663fb8..eaf1719 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -106,7 +106,7 @@ Ext.define('PVE.lxc.DNSEdit', {
 
 	Ext.apply(me, {
 	    subject: gettext('Resources'),
-	    items: ipanel
+	    items: [ ipanel ]
 	});
 
 	me.callParent();
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 3ef96a2..05807d2 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -71,7 +71,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 
 	var i, netlist = [];
 	for (i = 0; i < 10; i++) {
-	    netlist.push({ "name": "net" + i });
+	    netlist.push({ "name": "net" + i.toString() });
 	}
 	
 	var netliststore = Ext.create('Ext.data.Store', {
@@ -94,6 +94,8 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 		if (me.create && me.dataCache[value]) {
 		    return "Network ID already in use";
 		}
+		// validator can return bool/String
+		/*jslint confusion: true*/
 		return true;
 	    }
 	};
@@ -107,7 +109,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 		allowBlank: false,
 		value: cdata.name,
 		validator: function(value) {
-		    var result = true;
+		    var result = '';
 		    Ext.Object.each(me.dataCache, function(key, netstr) {
 			if (!key.match(/^net\d+/) || key === me.ifname) {
 			    return; // continue
@@ -118,7 +120,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 			    return false;
 			}
 		    });
-		    return result;
+		    if (result !== '') {
+			return result;
+		    }
+		    // validator can return bool/string
+		    /*jslint confusion:true*/
+		    return true;
 		}
 	    },
 	    {
diff --git a/www/manager6/lxc/Summary.js b/www/manager6/lxc/Summary.js
index 35cd10b..462f7fc 100644
--- a/www/manager6/lxc/Summary.js
+++ b/www/manager6/lxc/Summary.js
@@ -54,7 +54,7 @@ Ext.define('PVE.lxc.Summary', {
 		ptype: 'lazyitems',
 		items: [
 		    {
-			style: 'padding-top:0px',
+			style: {'padding-top': '0px' },
 			layout: {
 			    type: 'hbox',
 			    align: 'stretchmax'
diff --git a/www/manager6/node/Subscription.js b/www/manager6/node/Subscription.js
index 2eefcb0..50b3ad3 100644
--- a/www/manager6/node/Subscription.js
+++ b/www/manager6/node/Subscription.js
@@ -74,7 +74,7 @@ Ext.define('PVE.node.Subscription', {
 			    }
 			},
 		],
-	    items: [ view ]
+	    items: view
 	});
 
 	PVE.Utils.API2Request({
diff --git a/www/manager6/panel/ConfigPanel.js b/www/manager6/panel/ConfigPanel.js
index 33a4832..f79ffc9 100644
--- a/www/manager6/panel/ConfigPanel.js
+++ b/www/manager6/panel/ConfigPanel.js
@@ -50,14 +50,14 @@ Ext.define('PVE.panel.Config', {
 	    items.unshift({
 		itemId: 'search',
 		title: gettext('Search'),
-		layout: 'fit',
-		plugins: {
+		layout: { type:'fit' },
+		plugins: [{
 		    ptype: 'lazyitems',
-		    items: {
+		    items: [{
 			xtype: 'pveResourceGrid',
 			pveSelNode: me.pveSelNode
-		    }
-		}
+		    }]
+		}]
 	    });
 	}
 
diff --git a/www/manager6/panel/LogView.js b/www/manager6/panel/LogView.js
index 5022a62..5b64dec 100644
--- a/www/manager6/panel/LogView.js
+++ b/www/manager6/panel/LogView.js
@@ -54,7 +54,7 @@ Ext.define('PVE.panel.LogView', {
 	var maxDown = me.getMaxDown();
 	var scrollToEnd = (maxDown <= 0) && me.scrollToEnd;
 
-	el.setStyle('padding-top', start*me.lineHeight + 'px');
+	el.setStyle('padding-top', (start*me.lineHeight).toString() + 'px');
 	el.update(text);
 	me.dataCmp.setHeight(total*me.lineHeight);
 
diff --git a/www/manager6/panel/RRDChart.js b/www/manager6/panel/RRDChart.js
index c2742b4..5dd80a8 100644
--- a/www/manager6/panel/RRDChart.js
+++ b/www/manager6/panel/RRDChart.js
@@ -66,7 +66,7 @@ Ext.define('PVE.widget.RRDChart', {
 	// limit to 2 decimal points
 	value = Ext.util.Format.number(value, "0.##");
 
-	return value + " " + units[si];
+	return value.toString() + " " + units[si];
     },
 
     leftAxisRenderer: function(axis, label, layoutContext) {
diff --git a/www/manager6/qemu/BootOrderEdit.js b/www/manager6/qemu/BootOrderEdit.js
index 1d864e6..2954acf 100644
--- a/www/manager6/qemu/BootOrderEdit.js
+++ b/www/manager6/qemu/BootOrderEdit.js
@@ -48,7 +48,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
 	var res = { boot: order };
 
 	if  (me.bootdisk && order.indexOf('c') !== -1) {
-	    res['bootdisk'] = me.bootdisk;
+	    res.bootdisk = me.bootdisk;
 	} else {
 	    res['delete'] = 'bootdisk';
 	}
@@ -151,10 +151,10 @@ Ext.define('PVE.qemu.BootOrderPanel', {
 Ext.define('PVE.qemu.BootOrderEdit', {
     extend: 'PVE.window.Edit',
 
-    items: {
+    items: [{
 	xtype: 'pveQemuBootOrderPanel',
-	itemId: 'inputpanel',
-    },
+	itemId: 'inputpanel'
+    }],
 
     subject: gettext('Boot Order'),
 
diff --git a/www/manager6/qemu/CPUOptions.js b/www/manager6/qemu/CPUOptions.js
index 698a1fa..ce30ebb 100644
--- a/www/manager6/qemu/CPUOptions.js
+++ b/www/manager6/qemu/CPUOptions.js
@@ -11,11 +11,11 @@ Ext.define('PVE.qemu.CPUOptionsInputPanel', {
 	    delete_array.push('vcpus');
 	    delete values.vcpus;
 	}
-	if (values.cpulimit === '' || values.cpulimit == 0) {
+	if (values.cpulimit === '' || values.cpulimit == '0') {
 	    delete_array.push('cpulimit');
 	    delete values.cpulimit;
 	}
-	if (values.cpuunits === '' || values.cpuunits == 1024) {
+	if (values.cpuunits === '' || values.cpuunits == '1024') {
 	    delete_array.push('cpuunits');
 	    delete values.cpuunits;
 	}
@@ -58,7 +58,7 @@ Ext.define('PVE.qemu.CPUOptionsInputPanel', {
                 fieldLabel: gettext('CPU units'),
                 minValue: 8,
                 maxValue: 500000,
-                value: 1024,
+                value: '1024',
                 allowBlank: true
             }
 	];
@@ -81,7 +81,7 @@ Ext.define('PVE.qemu.CPUOptions', {
 	
 	Ext.apply(me, {
 	    subject: gettext('CPU options'),
-	    items: ipanel,
+	    items: [ ipanel ]
 	});
 
 	me.callParent();
diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js
index 74d0cd5..f6a4bc0 100644
--- a/www/manager6/qemu/MemoryEdit.js
+++ b/www/manager6/qemu/MemoryEdit.js
@@ -152,7 +152,7 @@ Ext.define('PVE.qemu.MemoryEdit', {
 
 	Ext.apply(me, {
 	    subject: gettext('Memory'),
-	    items: ipanel,
+	    items: [ ipanel ],
 	    // uncomment the following to use the async configiguration API
 	    // backgroundDelay: 5, 
 	    width: 400
diff --git a/www/manager6/qemu/ProcessorEdit.js b/www/manager6/qemu/ProcessorEdit.js
index 8f05a77..b3d52cb 100644
--- a/www/manager6/qemu/ProcessorEdit.js
+++ b/www/manager6/qemu/ProcessorEdit.js
@@ -6,8 +6,8 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
 	var me = this;
 
 	// build the cpu options:
-	me.cpu.cputype = values['cputype'];
-	delete values['cputype'];
+	me.cpu.cputype = values.cputype;
+	delete values.cputype;
 	var cpustring = PVE.Parser.printQemuCpu(me.cpu);
 
 	// remove cputype delete request:
@@ -21,14 +21,14 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
 	}
 
 	if (cpustring) {
-	    values['cpu'] = cpustring;
+	    values.cpu = cpustring;
 	} else {
 	    del.push('cpu');
 	}
 
-	del = del.join(',');
-	if (del) {
-	    values['delete'] = del;
+	var delarr = del.join(',');
+	if (delarr) {
+	    values['delete'] = delarr;
 	}
 
 	return values;
@@ -120,7 +120,7 @@ Ext.define('PVE.qemu.ProcessorEdit', {
 	me.load({
 	    success: function(response, options) {
 		var data = response.result.data;
-		var value = data['cpu'];
+		var value = data.cpu;
 		if (value) {
 		    var cpu = PVE.Parser.parseQemuCpu(value);
 		    ipanel.cpu = cpu;
diff --git a/www/manager6/storage/LVMEdit.js b/www/manager6/storage/LVMEdit.js
index 365d5af..39d70ef 100644
--- a/www/manager6/storage/LVMEdit.js
+++ b/www/manager6/storage/LVMEdit.js
@@ -172,6 +172,9 @@ Ext.define('PVE.storage.LVMInputPanel', {
 
 	me.column1.push(vgnameField);
 
+	// here value is an array, 
+	// while before it was a string
+	/*jslint confusion: true*/
 	me.column1.push({
 	    xtype: 'pveContentTypeSelector',
 	    cts: ['images', 'rootdir'],
@@ -181,6 +184,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
 	    multiSelect: true,
 	    allowBlank: false
 	});
+	/*jslint confusion: false*/
 
 	me.column2 = [
 	    {
diff --git a/www/manager6/storage/LvmThinEdit.js b/www/manager6/storage/LvmThinEdit.js
index 13fbb90..3fee638 100644
--- a/www/manager6/storage/LvmThinEdit.js
+++ b/www/manager6/storage/LvmThinEdit.js
@@ -168,6 +168,9 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
 
 	me.column1.push(thinpoolField);
 
+	// here value is an array,
+	// while before it was a string
+	/*jslint confusion: true*/
 	me.column1.push({
 	    xtype: 'pveContentTypeSelector',
 	    cts: ['images', 'rootdir'],
@@ -177,6 +180,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
 	    multiSelect: true,
 	    allowBlank: false
 	});
+	/*jslint confusion: false*/
 
 	me.column2 = [
 	    {
diff --git a/www/manager6/storage/RBDEdit.js b/www/manager6/storage/RBDEdit.js
index c98a4c5..a38ea52 100644
--- a/www/manager6/storage/RBDEdit.js
+++ b/www/manager6/storage/RBDEdit.js
@@ -52,6 +52,9 @@ Ext.define('PVE.storage.RBDInputPanel', {
 	    }
 	];
 
+	// here value is an array, 
+	// while before it was a string
+	/*jslint confusion: true*/
 	me.column2 = [
 	    {
 		xtype: 'pvecheckbox',
@@ -76,6 +79,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
 		fieldLabel: gettext('KRBD')
 	    }
 	];
+	/*jslint confusion: false*/
 
 	if (me.create || me.storageId !== 'local') {
 	    me.column2.unshift({
diff --git a/www/manager6/storage/Summary.js b/www/manager6/storage/Summary.js
index b0bfb35..2fb08a3 100644
--- a/www/manager6/storage/Summary.js
+++ b/www/manager6/storage/Summary.js
@@ -28,7 +28,7 @@ Ext.define('PVE.storage.Summary', {
 
 	var statusview = Ext.create('PVE.storage.StatusView', {
 	    pveSelNode: me.pveSelNode,
-	    style: 'padding-top:0px'
+	    style: {'padding-top':'0px'}
 	});
 
 	var rstore = statusview.rstore;
diff --git a/www/manager6/storage/ZFSPoolEdit.js b/www/manager6/storage/ZFSPoolEdit.js
index e227b2e..4328b1c 100644
--- a/www/manager6/storage/ZFSPoolEdit.js
+++ b/www/manager6/storage/ZFSPoolEdit.js
@@ -79,6 +79,9 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
 	    }));
 	}
 
+	// value is an array,
+	// while before it was a string
+	/*jslint confusion: true*/
 	me.column1.push(
 	    {xtype: 'pveContentTypeSelector',
 	     cts: ['images', 'rootdir'],
@@ -86,8 +89,9 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
 	     name: 'content',
 	     value: ['images', 'rootdir'],
 	     multiSelect: true,
-	     allowBlank: false});
-
+	     allowBlank: false
+	});
+	/*jslint confusion: false*/
 	me.column2 = [
 	    {
 		xtype: 'pvecheckbox',
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 202a46f..1f5a2c9 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -104,7 +104,7 @@ Ext.define('PVE.tree.ResourceTree', {
 
 	var defaults = PVE.tree.ResourceTree.typeDefaults[info.type];
 	if (info.id === 'root') {
-	    defaults = PVE.tree.ResourceTree.typeDefaults['datacenter'];
+	    defaults = PVE.tree.ResourceTree.typeDefaults.datacenter;
 	} else if (info.type === 'type') {
 	    defaults = PVE.tree.ResourceTree.typeDefaults[info.groupbyid];
 	}
@@ -128,7 +128,7 @@ Ext.define('PVE.tree.ResourceTree', {
 
 	    if (info.template) {
 		iconClsAdd = '-template';
-		info.iconCls = PVE.tree.ResourceTree.typeDefaults['template'].iconCls + '-' + info.type;
+		info.iconCls = PVE.tree.ResourceTree.typeDefaults.template.iconCls + '-' + info.type;
 	    }
 
 	}
diff --git a/www/manager6/window/SafeDestroy.js b/www/manager6/window/SafeDestroy.js
index 8dd1f89..394f245 100644
--- a/www/manager6/window/SafeDestroy.js
+++ b/www/manager6/window/SafeDestroy.js
@@ -11,7 +11,7 @@ Ext.define('PVE.window.SafeDestroy', {
     buttonAlign: 'center',
     bodyPadding: 10,
     width: 450,
-    layout: 'hbox',
+    layout: { type:'hbox' },
     defaultFocus: 'confirmField',
 
     config: {
-- 
2.1.4





More information about the pve-devel mailing list