[pve-devel] [PATCH manager 01/10] jslint: fix curly braces for if
Dominik Csapak
d.csapak at proxmox.com
Fri Apr 29 12:06:26 CEST 2016
in one change, there is also a change from object['property']
to object.property which jslint complains about
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/Parser.js | 8 +++++---
www/manager6/dc/AuthEdit.js | 8 ++++++--
www/manager6/lxc/Network.js | 10 ++++++----
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js
index 18136b7..3f15d8f 100644
--- a/www/manager6/Parser.js
+++ b/www/manager6/Parser.js
@@ -6,8 +6,9 @@ Ext.define('PVE.Parser', { statics: {
// this class only contains static functions
parseBoolean: function(value, default_value) {
- if (!Ext.isDefined(value))
+ if (!Ext.isDefined(value)) {
return default_value;
+ }
value = value.toLowerCase();
return value === 1 || value === '1' ||
value === 'on' ||
@@ -407,7 +408,7 @@ Ext.define('PVE.Parser', { statics: {
var datastr = '';
Ext.Object.each(data, function(key, value) {
- if (value === '') return;
+ if (value === '') { return; }
datastr += (datastr !== '' ? ',' : '') + key + '=' + value;
});
@@ -481,8 +482,9 @@ Ext.define('PVE.Parser', { statics: {
});
if (!cpustr) {
- if (optstr)
+ if (optstr) {
return 'kvm64' + optstr;
+ }
return;
}
diff --git a/www/manager6/dc/AuthEdit.js b/www/manager6/dc/AuthEdit.js
index d6ad1b6..ca305e9 100644
--- a/www/manager6/dc/AuthEdit.js
+++ b/www/manager6/dc/AuthEdit.js
@@ -64,13 +64,17 @@ Ext.define('PVE.dc.AuthEdit', {
});
} else if (me.authType === 'pve') {
- if (me.create) throw 'unknown auth type';
+ if (me.create) {
+ throw 'unknown auth type';
+ }
me.subject = 'Proxmox VE authentication server';
} else if (me.authType === 'pam') {
- if (me.create) throw 'unknown auth type';
+ if (me.create) {
+ throw 'unknown auth type';
+ }
me.subject = 'linux PAM';
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 9bfdfb5..3ef96a2 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -34,10 +34,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
var newdata = {};
- if (values['ipv6mode'] !== 'static')
- values['ip6'] = values['ipv6mode'];
- if (values['ipv4mode'] !== 'static')
- values['ip'] = values['ipv4mode']
+ if (values.ipv6mode !== 'static') {
+ values.ip6 = values.ipv6mode;
+ }
+ if (values.ipv4mode !== 'static') {
+ values.ip = values.ipv4mode;
+ }
newdata[id] = PVE.Parser.printLxcNetwork(values);
return newdata;
},
--
2.1.4
More information about the pve-devel
mailing list