[pve-devel] r6277 - in pve-manager/pve2/www/manager: node panel

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 8 14:22:09 CEST 2011


Author: dietmar
Date: 2011-07-08 14:22:09 +0200 (Fri, 08 Jul 2011)
New Revision: 6277

Modified:
   pve-manager/pve2/www/manager/node/Config.js
   pve-manager/pve2/www/manager/node/DNSEdit.js
   pve-manager/pve2/www/manager/node/DNSView.js
   pve-manager/pve2/www/manager/node/NetworkEdit.js
   pve-manager/pve2/www/manager/node/NetworkView.js
   pve-manager/pve2/www/manager/node/ServiceView.js
   pve-manager/pve2/www/manager/node/StatusView.js
   pve-manager/pve2/www/manager/node/Summary.js
   pve-manager/pve2/www/manager/node/Syslog.js
   pve-manager/pve2/www/manager/node/Tasks.js
   pve-manager/pve2/www/manager/node/TimeEdit.js
   pve-manager/pve2/www/manager/node/TimeView.js
   pve-manager/pve2/www/manager/panel/ConfigPanel.js
Log:
make lint happy


Modified: pve-manager/pve2/www/manager/node/Config.js
===================================================================
--- pve-manager/pve2/www/manager/node/Config.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/Config.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,8 +6,9 @@
         var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	Ext.apply(me, {
 	    title: "Node '" + nodename + "'",
@@ -31,7 +32,7 @@
 		{
 		    title: 'DNS',
 		    itemId: 'dns',
-		    xtype: 'pveNodeDNSView',
+		    xtype: 'pveNodeDNSView'
 		},
 		{
 		    title: 'Time',

Modified: pve-manager/pve2/www/manager/node/DNSEdit.js
===================================================================
--- pve-manager/pve2/www/manager/node/DNSEdit.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/DNSEdit.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -10,9 +10,10 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
-	
+	}
+
 	me.items = [
 	    {
 		xtype: 'textfield',
@@ -29,15 +30,15 @@
 	    },
 	    {
 		xtype: 'pvetextfield',
-                fieldLabel: 'Second DNS server',
- 		vtype: 'IPAddress',
+		fieldLabel: 'Second DNS server',
+		vtype: 'IPAddress',
 		skipEmptyText: true,
                 name: 'dns2'
 	    },
 	    {
 		xtype: 'pvetextfield',
                 fieldLabel: 'Third DNS server',
- 		vtype: 'IPAddress',
+		vtype: 'IPAddress',
 		skipEmptyText: true,
                 name: 'dns3'
 	    }
@@ -49,7 +50,7 @@
 	    fieldDefaults: {
 		labelWidth: 120
 	    }
-  	});
+	});
 
 	me.callParent();
 

Modified: pve-manager/pve2/www/manager/node/DNSView.js
===================================================================
--- pve-manager/pve2/www/manager/node/DNSView.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/DNSView.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,10 +6,10 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
-
 	var run_editor = function() {
 	    var win = Ext.create('PVE.node.DNSEdit', { 
 		pveSelNode: me.pveSelNode
@@ -25,7 +25,7 @@
 		search: { header: 'Search domain', required: true },
 		dns1: { header: 'First DNS server', required: true },
 		dns2: { header: 'Second DNS server' },
-		dns3: { header: 'Third DNS server' },
+		dns3: { header: 'Third DNS server' }
 	    },
 	    tbar: [ 
 		{

Modified: pve-manager/pve2/www/manager/node/NetworkEdit.js
===================================================================
--- pve-manager/pve2/www/manager/node/NetworkEdit.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/NetworkEdit.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,11 +6,13 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
-	if (!me.iftype) 
+	if (!me.iftype) {
 	    throw "no network device type specified";
+	}
 
 	me.create = !me.iface;
 
@@ -24,8 +26,9 @@
 	    } else if (me.iftype === 'bond') {
 		title = "Create Bond";
 		iface_vtype = 'BondName';
-	    } else 
+	    } else {
 		throw "can't create unknown device type";
+	    }
 	} else {
 	    title = "Edit network device '" + me.iface + "'";
 	}
@@ -95,15 +98,19 @@
 		vtype: 'IPAddress',
 		name: 'netmask',
 		validator: function(value) {
-		    if (!me.items)
+		    /*jslint confusion: true */
+		    if (!me.items) {
 			return true;
+		    }
 		    var address = me.down('field[name=address]').getValue();
 		    if (value !== '') {
-			if (address === '')
+			if (address === '') {
 			    return "Subnet mask requires option 'IP address'";
+			}
 		    } else {
-			if (address !== '')
+			if (address !== '') {
 			    return "Option 'IP address' requires a subnet mask";
+			}
 		    }
 		    
 		    return true;

Modified: pve-manager/pve2/www/manager/node/NetworkView.js
===================================================================
--- pve-manager/pve2/www/manager/node/NetworkView.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/NetworkView.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -7,8 +7,9 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var rstore = Ext.create('PVE.data.UpdateStore', {
 	    interval: 1000,
@@ -16,7 +17,7 @@
 	    model: 'pve-networks',
 	    proxy: {
                 type: 'pve',
-                url: "/api2/json/nodes/" + nodename + "/network",
+                url: "/api2/json/nodes/" + nodename + "/network"
 	    },
 	    sorters: [
 		{
@@ -38,8 +39,9 @@
 		success: function(response, opts) {
 		    var result = Ext.decode(response.responseText);
 		    var data = result.data;
-		    if (data === '')
-			data = "no changes"
+		    if (data === '') {
+			data = "no changes";
+		    }
 		    changeitem.update("<pre>" + Ext.htmlEncode(data) + "</pre>");
 		}
 	    });
@@ -54,8 +56,9 @@
 	    var grid = me.down('gridpanel');
 	    var sm = grid.getSelectionModel();
 	    var rec = sm.getSelection()[0];
-	    if (!rec)
+	    if (!rec) {
 		return;
+	    }
 
 	    var win = Ext.create('PVE.node.NetworkEdit', {
 		pveSelNode: me.pveSelNode,
@@ -63,7 +66,7 @@
 		iftype: rec.data.type
 	    });
 	    win.show();
-	    win.on('destroy', reload)
+	    win.on('destroy', reload);
 	};
 
 	var edit_btn = new Ext.Button({
@@ -79,8 +82,9 @@
 		var grid = me.down('gridpanel');
 		var sm = grid.getSelectionModel();
 		var rec = sm.getSelection()[0];
-		if (!rec)
+		if (!rec) {
 		    return;
+		}
 
 		var iface = rec.data.iface;
 
@@ -118,10 +122,11 @@
 	});
 
 	var render_ports = function(value, metaData, record) {
-	    if (value === 'bridge')
+	    if (value === 'bridge') {
 		return record.data.bridge_ports;
-	    if (value === 'bond')
+	    } else if (value === 'bond') {
 		return record.data.slaves;
+	    }
 	};
 
 	Ext.apply(me, {
@@ -136,16 +141,17 @@
 				handler: function() {
 				    var next;
 				    for (next = 0; next <= 9999; next++) {
-					if (!rstore.data.get('vmbr' + next))
+					if (!rstore.data.get('vmbr' + next.toString())) {
 					    break;
+					}
 				    }
 				    
 				    var win = Ext.create('PVE.node.NetworkEdit', {
 					pveSelNode: me.pveSelNode,
 					iftype: 'bridge',
-					iface_default: 'vmbr' + next
+					iface_default: 'vmbr' + next.toString()
 				    });
-				    win.on('destroy', reload)
+				    win.on('destroy', reload);
 				    win.show();
 				}
 			    },
@@ -154,15 +160,16 @@
 				handler: function() {
 				    var next;
 				    for (next = 0; next <= 9999; next++) {
-					if (!rstore.data.get('bond' + next))
+					if (!rstore.data.get('bond' + next.toString())) {
 					    break;
+					}
 				    }
 				    var win = Ext.create('PVE.node.NetworkEdit', {
 					pveSelNode: me.pveSelNode,
 					iftype: 'bond',
-					iface_default: 'bond' + next
+					iface_default: 'bond' + next.toString()
 				    });
-				    win.on('destroy', reload)
+				    win.on('destroy', reload);
 				    win.show();
 				}
 			    } 
@@ -205,7 +212,7 @@
 			},
 			{
 			    xtype: 'booleancolumn', 
- 			    header: 'Active',
+			    header: 'Active',
 			    width: 80,
 			    sortable: true,
 			    dataIndex: 'active',
@@ -215,7 +222,7 @@
 			},
 			{
 			    xtype: 'booleancolumn', 
- 			    header: 'Autostart',
+			    header: 'Autostart',
 			    width: 80,
 			    sortable: true,
 			    dataIndex: 'autostart',

Modified: pve-manager/pve2/www/manager/node/ServiceView.js
===================================================================
--- pve-manager/pve2/www/manager/node/ServiceView.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/ServiceView.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -7,8 +7,9 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var rstore = Ext.create('PVE.data.UpdateStore', {
 	    interval: 1000,
@@ -16,7 +17,7 @@
 	    model: 'pve-services',
 	    proxy: {
                 type: 'pve',
-                url: "/api2/json/nodes/" + nodename + "/services",
+                url: "/api2/json/nodes/" + nodename + "/services"
 	    }
 	});
 
@@ -137,7 +138,7 @@
 		selectionchange: set_button_status,
 		show: rstore.startUpdate,
 		hide: rstore.stopUpdate,
-		destroy: rstore.stopUpdate,
+		destroy: rstore.stopUpdate
 	    }
 	});
 

Modified: pve-manager/pve2/www/manager/node/StatusView.js
===================================================================
--- pve-manager/pve2/www/manager/node/StatusView.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/StatusView.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,8 +6,9 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var render_cpuinfo = function(value) {
 	    return value.cpus + " x " + value.model;
@@ -38,8 +39,8 @@
 	    memory: { header: 'RAM usage', required: true, renderer: render_meminfo },
 	    swap: { header: 'SWAP usage', required: true, renderer: render_meminfo },
 	    rootfs: { header: 'HD space (root)', required: true, renderer: render_meminfo },
-	    pveversion: { header: 'PVE Manager version', required: true,},
-	    kversion: { header: 'Kernel version', required: true,}
+	    pveversion: { header: 'PVE Manager version', required: true },
+	    kversion: { header: 'Kernel version', required: true }
 	};
 
 	Ext.applyIf(me, {

Modified: pve-manager/pve2/www/manager/node/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/node/Summary.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/Summary.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,8 +6,9 @@
         var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var statusview = Ext.create('PVE.node.StatusView', {
 	    title: 'Status',
@@ -42,8 +43,9 @@
 		    handler: function() { 
 			var msg = "Do you really want to reboot node '" + nodename + "'?";
 			Ext.Msg.confirm('Confirm', msg, function(btn) {
-			    if (btn !== 'yes')
+			    if (btn !== 'yes') {
 				return;
+			    }
 			    node_command('reboot');
 			});
 		    }
@@ -54,8 +56,9 @@
 		    handler: function() { 
 			var msg = "Do you really want to shutdown node '" + nodename + "'?";
 			Ext.Msg.confirm('Confirm', msg, function(btn) {
-			    if (btn !== 'yes')
+			    if (btn !== 'yes') {
 				return;
+			    }
 			    node_command('shutdown');
 			});
 		    }

Modified: pve-manager/pve2/www/manager/node/Syslog.js
===================================================================
--- pve-manager/pve2/www/manager/node/Syslog.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/Syslog.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -7,12 +7,13 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var store = Ext.create('Ext.data.Store', {
 	    pageSize: 500,
- 	    buffered: true,
+	    buffered: true,
 	    model: 'pve-string-list',
 	    proxy: {
                 type: 'pve',

Modified: pve-manager/pve2/www/manager/node/Tasks.js
===================================================================
--- pve-manager/pve2/www/manager/node/Tasks.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/Tasks.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -7,21 +7,21 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var store = Ext.create('Ext.data.Store', {
 	    pageSize: 500,
- 	    buffered: true,
+	    buffered: true,
 	    remoteFilter: true,
 	    model: 'pve-tasks',
 	    proxy: {
                 type: 'pve',
 		startParam: 'start',
 		limitParam: 'limit',
-
                 url: "/api2/json/nodes/" + nodename + "/tasks"
-	    },
+	    }
 	});
 
 	var userfilter = '';
@@ -33,9 +33,9 @@
 	    var params = {
 		errors: filter_errors
 	    };
-	    if (userfilter)
+	    if (userfilter) {
 		params.userfilter = userfilter;
-
+	    }
 	    store.proxy.extraParams = params;
 	    store.filter();
 	});
@@ -43,8 +43,9 @@
 	var run_task_viewer = function() {
 	    var sm = me.getSelectionModel();
 	    var rec = sm.getSelection()[0];
-	    if (!rec)
+	    if (!rec) {
 		return;
+	    }
 
 	    var win = Ext.create('PVE.window.TaskViewer', { 
 		upid: rec.data.upid
@@ -72,8 +73,9 @@
 		getRowClass: function(record, index) {
 		    var status = record.get('status');
 
-		    if (status && status != 'OK') 
+		    if (status && status != 'OK') {
 			return "x-form-invalid-field";
+		    }
 		}
 	    },
 	    tbar: [
@@ -135,8 +137,9 @@
 		    header: "Status", dataIndex: 'status', 
 		    width: 200,
 		    renderer: function(value, metaData, record) { 
-			if (value == 'OK')
+			if (value == 'OK') {
 			    return 'OK';
+			}
 			// metaData.attr = 'style="color:red;"'; 
 			return "ERROR: " + value;
 		    }

Modified: pve-manager/pve2/www/manager/node/TimeEdit.js
===================================================================
--- pve-manager/pve2/www/manager/node/TimeEdit.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/TimeEdit.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -7,8 +7,9 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	Ext.applyIf(me, {
 	    title: "Set time zone",
@@ -24,7 +25,7 @@
 		queryMode: 'local',
 		store: new PVE.data.TimezoneStore({autoDestory: true}),
 		valueField: 'zone',
- 		displayField: 'zone',
+		displayField: 'zone',
 		triggerAction: 'all',
 		forceSelection: true,
 		editable: false,

Modified: pve-manager/pve2/www/manager/node/TimeView.js
===================================================================
--- pve-manager/pve2/www/manager/node/TimeView.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/node/TimeView.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -6,8 +6,9 @@
 	var me = this;
 
 	var nodename = me.pveSelNode.data.node;
-	if (!nodename) 
+	if (!nodename) {
 	    throw "no node name specified";
+	}
 
 	var tzoffset = (new Date()).getTimezoneOffset()*60000;
 	var renderlocaltime = function(value) {
@@ -29,7 +30,7 @@
 	    rows: {
 		timezone: { 
 		    header: 'Time zone', 
-		    required: true, 
+		    required: true
 		},
 		localtime: { 
 		    header: 'Server time', 

Modified: pve-manager/pve2/www/manager/panel/ConfigPanel.js
===================================================================
--- pve-manager/pve2/www/manager/panel/ConfigPanel.js	2011-07-08 12:05:02 UTC (rev 6276)
+++ pve-manager/pve2/www/manager/panel/ConfigPanel.js	2011-07-08 12:22:09 UTC (rev 6277)
@@ -42,12 +42,12 @@
 		    var ntab = newcard.itemId;
 		    // Note: '' is alias for first tab.
 		    // First tab can be 'search' or something else
-		    if (newcard.itemId === items[0].itemId)
+		    if (newcard.itemId === items[0].itemId) {
 			ntab = '';
+		    }
 		    var state = { value: ntab };
 		    if (stateid) {
 			sp.set(stateid, state);
-
 		    }
 		}
 	    },



More information about the pve-devel mailing list