[pve-devel] r6270 - pve-manager/pve2/www/manager/data
svn-commits at proxmox.com
svn-commits at proxmox.com
Fri Jul 8 11:56:24 CEST 2011
Author: dietmar
Date: 2011-07-08 11:56:24 +0200 (Fri, 08 Jul 2011)
New Revision: 6270
Modified:
pve-manager/pve2/www/manager/data/ObjectStore.js
pve-manager/pve2/www/manager/data/ResourceStore.js
Log:
make lint happy
Modified: pve-manager/pve2/www/manager/data/ObjectStore.js
===================================================================
--- pve-manager/pve2/www/manager/data/ObjectStore.js 2011-07-08 09:11:57 UTC (rev 6269)
+++ pve-manager/pve2/www/manager/data/ObjectStore.js 2011-07-08 09:56:24 UTC (rev 6270)
@@ -11,7 +11,7 @@
}
Ext.applyIf(config, {
- model: 'KeyValue',
+ model: 'KeyValue',
proxy: {
type: 'pve',
url: config.url,
Modified: pve-manager/pve2/www/manager/data/ResourceStore.js
===================================================================
--- pve-manager/pve2/www/manager/data/ResourceStore.js 2011-07-08 09:11:57 UTC (rev 6269)
+++ pve-manager/pve2/www/manager/data/ResourceStore.js 2011-07-08 09:56:24 UTC (rev 6270)
@@ -7,18 +7,23 @@
var me = this, i;
for (i = 100; i < 10000; i++) {
- if (me.findExact('vmid', i) < 0)
+ if (me.findExact('vmid', i) < 0) {
return i;
+ }
}
},
findVMID: function(vmid) {
var me = this, i;
- return (me.findExact('vmid', parseInt(vmid)) >= 0);
+ return (me.findExact('vmid', parseInt(vmid, 10)) >= 0);
},
+
constructor: function(config) {
+ // fixme: how to avoid those warnings
+ /*jslint confusion: true */
+
var me = this;
config = config || {};
@@ -48,8 +53,9 @@
var info = record.data;
var text;
- if (value)
+ if (value) {
return value;
+ }
if (info.type === 'node') {
text = info.node;
@@ -57,8 +63,9 @@
text = info.storage + ' (' + info.node + ')';
} else if (info.type === 'qemu' || info.type === 'openvz') {
text = String(info.vmid);
- if (info.name)
+ if (info.name) {
text += " (" + info.name + ')';
+ }
} else {
text = info.id;
}
@@ -147,10 +154,11 @@
var fields = [];
Ext.Object.each(field_defaults, function(key, value) {
- if (!Ext.isDefined(value.convert))
+ if (!Ext.isDefined(value.convert)) {
fields.push({name: key, type: value.type});
- else if (key === 'text')
- fields.push({name: key, type: value.type, convert: value.convert});
+ } else if (key === 'text') {
+ fields.push({name: key, type: value.type, convert: value.convert});
+ }
});
Ext.define('PVEResources', {
@@ -173,13 +181,11 @@
model: 'PVEResources',
autoDestory: false,
defaultColums: function() {
-
var res = [];
- for (field in field_defaults) {
- var info = field_defaults[field];
+ Ext.Object.each(field_defaults, function(field, info) {
var fi = Ext.apply({ dataIndex: field }, info);
res.push(fi);
- }
+ });
return res;
}
More information about the pve-devel
mailing list