[pve-devel] r6271 - pve-manager/pve2/www/manager/form

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 8 12:14:40 CEST 2011


Author: dietmar
Date: 2011-07-08 12:14:40 +0200 (Fri, 08 Jul 2011)
New Revision: 6271

Modified:
   pve-manager/pve2/www/manager/form/BridgeSelector.js
   pve-manager/pve2/www/manager/form/BusTypeSelector.js
   pve-manager/pve2/www/manager/form/Checkbox.js
   pve-manager/pve2/www/manager/form/ComboGrid.js
   pve-manager/pve2/www/manager/form/FileSelector.js
   pve-manager/pve2/www/manager/form/NodeSelector.js
   pve-manager/pve2/www/manager/form/RRDTypeSelector.js
   pve-manager/pve2/www/manager/form/RealmComboBox.js
   pve-manager/pve2/www/manager/form/StorageSelector.js
   pve-manager/pve2/www/manager/form/TextField.js
   pve-manager/pve2/www/manager/form/ViewSelector.js
Log:
make lint happy


Modified: pve-manager/pve2/www/manager/form/BridgeSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/BridgeSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/BridgeSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -9,8 +9,9 @@
     setNodename: function(nodename) {
 	var me = this;
 
-	if (!nodename || (me.nodename === nodename))
+	if (!nodename || (me.nodename === nodename)) {
 	    return;
+	}
 
 	me.nodename = nodename;
 
@@ -53,12 +54,13 @@
 		    }
 		]
 	    }
- 	});
+	});
 
         me.callParent();
 
-	if (nodename)
+	if (nodename) {
 	    me.setNodename(nodename);
+	}
     }
 });
 

Modified: pve-manager/pve2/www/manager/form/BusTypeSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/BusTypeSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/BusTypeSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -7,11 +7,13 @@
 
 	me.data = [['ide', 'IDE']];
 
-	if (!me.noVirtIO) 
+	if (!me.noVirtIO) {
 	    me.data.push(['virtio', 'VIRTIO']);
+	}
 
-	if (!me.noScsi) 
+	if (!me.noScsi) {
 	    me.data.push(['scsi', 'SCSI']);
+	}
 
 	me.callParent();
     }

Modified: pve-manager/pve2/www/manager/form/Checkbox.js
===================================================================
--- pve-manager/pve2/www/manager/form/Checkbox.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/Checkbox.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -8,9 +8,10 @@
     setRawValue: function(value) {
 	var me = this;
 
-	if (value === 1)
-	    value = true;
-
-        me.callParent([value]);
+	if (value === 1) {
+            me.callParent([true]);
+	} else {
+            me.callParent([value]);
+	}
     }
 });
\ No newline at end of file

Modified: pve-manager/pve2/www/manager/form/ComboGrid.js
===================================================================
--- pve-manager/pve2/www/manager/form/ComboGrid.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/ComboGrid.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -75,8 +75,9 @@
 
 	me.store.on('beforeload', function() {
 	    var form = me.up('form');
-	    if (form)
+	    if (form) {
 		form.setLoading(true, true);
+	    }
 	});
 
 	// hack: autoSelect does not work
@@ -84,8 +85,9 @@
 	    var form = me.up('form');
 	    if (success) {
 		var def = me.getValue();
-		if (def)
+		if (def) {
 		    me.setValue(def, true); // sync with grid
+		}
 		if (!def || !store.findRecord(me.valueField, def)) {
 		    var rec = me.store.first();
 		    if (me.autoSelect && rec && rec.data) {
@@ -96,8 +98,9 @@
 		    }
 		}
 	    }
-	    if (form)
+	    if (form) {
 		form.setLoading(false);
+	    }
 	});
     }
 });
\ No newline at end of file

Modified: pve-manager/pve2/www/manager/form/FileSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/FileSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/FileSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -20,12 +20,14 @@
 	    change = true;
 	}
 
-	if (!(me.storage && me.nodename && change))
+	if (!(me.storage && me.nodename && change)) {
 	    return;
-	
+	}
+
 	var url = '/api2/json/nodes/' + me.nodename + '/storage/' + me.storage + '/content';
-	if (me.storageContent)
+	if (me.storageContent) {
 	    url += '?content=' + me.storageContent;
+	}
 
 	me.store.setProxy({
 	    type: 'pve',
@@ -44,9 +46,10 @@
 		{	
 		    name: 'text', 
 		    convert: function(value, record) {
-			if (value)
+			if (value) {
 			    return value;
-			return record.data.volid.replace(/^.*:.*\//,'');;
+			}
+			return record.data.volid.replace(/^.*:.*\//,'');
 		    }
 		}
 	    ]
@@ -79,7 +82,7 @@
 		    }
 		]
 	    }
- 	});
+	});
 
         me.callParent();
 

Modified: pve-manager/pve2/www/manager/form/NodeSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/NodeSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/NodeSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -58,13 +58,15 @@
 		]
 	    },
 	    validator: function(value) {
+		/*jslint confusion: true */
 		var rec = me.store.findRecord(me.valueField, value);
-		if (rec && rec.data && Ext.isNumeric(rec.data.mem))
+		if (rec && rec.data && Ext.isNumeric(rec.data.mem)) {
 		    return true;
+		}
 
 		return "Node " + value + " seems to be offline!";
 	    }
- 	});
+	});
 
         me.callParent();
     }

Modified: pve-manager/pve2/www/manager/form/RRDTypeSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/RRDTypeSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/RRDTypeSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -21,7 +21,7 @@
 		[ 'month', 'month', 'AVERAGE', "Month (average)" ],
 		[ 'monthmax', 'month', 'MAX', "Month (max)" ],
 		[ 'year', 'year', 'AVERAGE', "Year (average)" ],
-		[ 'yearmax', 'year', 'MAX', "Year (max)" ],
+		[ 'yearmax', 'year', 'MAX', "Year (max)" ]
 	    ]
 	});
 
@@ -29,13 +29,15 @@
             store: store,
             displayField: 'text',
 	    valueField: 'id',
- 	    editable: false,
+	    editable: false,
             queryMode: 'local',
 	    value: 'hour',
- 	    getState: function() {
+	    getState: function() {
 		var ind = store.findExact('id', me.getValue());
 		var rec = store.getAt(ind);
-		if (!rec) return;
+		if (!rec) {
+		    return;
+		}
 		return { 
 		    id: rec.data.id,
 		    timeframe: rec.data.timeframe,

Modified: pve-manager/pve2/www/manager/form/RealmComboBox.js
===================================================================
--- pve-manager/pve2/www/manager/form/RealmComboBox.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/RealmComboBox.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -47,12 +47,14 @@
 		    if (!def || !realmstore.findRecord('realm', def)) {
 			def = 'pam';
 			Ext.each(r, function(record) {
-			    if (record.data && record.data["default"]) 
+			    if (record.data && record.data["default"]) { 
 				def = record.data.realm;
+			    }
 			});
 		    }
-		    if (def)
-			me.setValue(def)
+		    if (def) {
+			me.setValue(def);
+		    }
 		}
 	    }
 	});

Modified: pve-manager/pve2/www/manager/form/StorageSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/StorageSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/StorageSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -9,14 +9,16 @@
     setNodename: function(nodename) {
 	var me = this;
 
-	if (!nodename || (me.nodename === nodename))
+	if (!nodename || (me.nodename === nodename)) {
 	    return;
+	}
 
 	me.nodename = nodename;
 
 	var url = '/api2/json/nodes/' + me.nodename + '/storage';
-	if (me.storageContent)
+	if (me.storageContent) {
 	    url += '?content=' + me.storageContent;
+	}
 
 	me.store.setProxy({
 	    type: 'pve',
@@ -68,11 +70,12 @@
 		    }
 		]
 	    }
- 	});
+	});
 
         me.callParent();
 
-	if (nodename)
+	if (nodename) {
 	    me.setNodename(nodename);
+	}
     }
 });
\ No newline at end of file

Modified: pve-manager/pve2/www/manager/form/TextField.js
===================================================================
--- pve-manager/pve2/www/manager/form/TextField.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/TextField.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -27,8 +27,9 @@
 	var me = this;
 
         var value = this.processRawValue(this.getRawValue());
-	if (value !== '')
+	if (value !== '') {
 	    return value;
+	}
 
 	return me.skipEmptyText ? null: value; 
     }

Modified: pve-manager/pve2/www/manager/form/ViewSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/ViewSelector.js	2011-07-08 09:56:24 UTC (rev 6270)
+++ pve-manager/pve2/www/manager/form/ViewSelector.js	2011-07-08 10:14:40 UTC (rev 6271)
@@ -35,7 +35,7 @@
 		type: 'memory',
 		reader: 'array'
             },
- 	    data: groupdef,
+	    data: groupdef,
 	    autoload: true,
 	    autoDestory: true
 	});
@@ -70,13 +70,13 @@
 			me.setValue(state.value, true);
 			if (doSelect) {
 			    me.fireEvent('select', me, [record]);
- 			}
+			}
 		    }
 		}
 	    },
 	    stateEvents: [ 'select' ],
 	    stateful: true,
-  	    id: 'view'
+	    id: 'view'
 	});
 
 	me.callParent();



More information about the pve-devel mailing list