[pve-devel] r6273 - in pve-manager/pve2/www/manager: dc panel window
svn-commits at proxmox.com
svn-commits at proxmox.com
Fri Jul 8 12:35:46 CEST 2011
Author: dietmar
Date: 2011-07-08 12:35:46 +0200 (Fri, 08 Jul 2011)
New Revision: 6273
Modified:
pve-manager/pve2/www/manager/dc/Log.js
pve-manager/pve2/www/manager/dc/Tasks.js
pve-manager/pve2/www/manager/panel/RRDView.js
pve-manager/pve2/www/manager/window/Edit.js
pve-manager/pve2/www/manager/window/LoginWindow.js
pve-manager/pve2/www/manager/window/TaskViewer.js
pve-manager/pve2/www/manager/window/Wizard.js
Log:
make lint happy
Modified: pve-manager/pve2/www/manager/dc/Log.js
===================================================================
--- pve-manager/pve2/www/manager/dc/Log.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/dc/Log.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -31,8 +31,9 @@
getRowClass: function(record, index) {
var pri = record.get('pri');
- if (pri && pri <= 3)
+ if (pri && pri <= 3) {
return "x-form-invalid-field";
+ }
}
},
sortableColumns: false,
@@ -58,7 +59,7 @@
{
header: "PID",
dataIndex: 'pid',
- width: 100,
+ width: 100
},
{
header: "User",
@@ -84,6 +85,6 @@
}
});
- me.callParent();
+ me.callParent();
}
});
\ No newline at end of file
Modified: pve-manager/pve2/www/manager/dc/Tasks.js
===================================================================
--- pve-manager/pve2/www/manager/dc/Tasks.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/dc/Tasks.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -29,8 +29,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
@@ -49,8 +50,9 @@
getRowClass: function(record, index) {
var status = record.get('status');
- if (status && status != 'OK')
+ if (status && status != 'OK') {
return "x-form-invalid-field";
+ }
}
},
sortableColumns: false,
@@ -99,9 +101,10 @@
if (record.data.pid) {
metaData.tdCls = "x-grid-row-loading";
return "";
- }
- if (value == 'OK')
- return 'OK';
+ }
+ if (value == 'OK') {
+ return 'OK';
+ }
// metaData.attr = 'style="color:red;"';
return "ERROR: " + value;
}
@@ -115,6 +118,6 @@
}
});
- me.callParent();
+ me.callParent();
}
});
\ No newline at end of file
Modified: pve-manager/pve2/www/manager/panel/RRDView.js
===================================================================
--- pve-manager/pve2/www/manager/panel/RRDView.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/panel/RRDView.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -5,16 +5,21 @@
initComponent : function() {
var me = this;
- if (!me.timeframe)
+ if (!me.timeframe) {
me.timeframe = 'hour';
- if (!me.rrdcffn)
+ }
+
+ if (!me.rrdcffn) {
me.rrdcffn = 'AVERAGE';
+ }
- if (!me.datasource)
+ if (!me.datasource) {
throw "no datasource specified";
+ }
- if (!me.rrdurl)
+ if (!me.rrdurl) {
throw "no rrdurl specified";
+ }
var datasource = me.datasource;
@@ -23,10 +28,10 @@
var create_url = function() {
var url = me.rrdurl + "?ds=" + datasource +
"&timeframe=" + me.timeframe + "&cf=" + me.rrdcffn +
- "&_dc=" + dcindex;
+ "&_dc=" + dcindex.toString();
dcindex++;
return url;
- }
+ };
var stateid = 'pveRRDTypeSelection';
Modified: pve-manager/pve2/www/manager/window/Edit.js
===================================================================
--- pve-manager/pve2/www/manager/window/Edit.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/window/Edit.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -1,3 +1,6 @@
+// fixme: how can we avoid those lint errors?
+/*jslint confusion: true */
+
Ext.define('PVE.window.Edit', {
extend: 'Ext.window.Window',
@@ -62,8 +65,9 @@
initComponent : function() {
var me = this;
- if (!me.url)
+ if (!me.url) {
throw "no url specified";
+ }
var items;
@@ -92,7 +96,7 @@
}
];
} else {
- throw "unsupported config"
+ throw "unsupported config";
}
var formpanel = Ext.create('Ext.form.Panel', {
@@ -140,15 +144,16 @@
form.on('validitychange', set_button_status);
var colwidth = 300;
- if (me.fieldDefaults && me.fieldDefaults.labelWidth)
+ if (me.fieldDefaults && me.fieldDefaults.labelWidth) {
colwidth += me.fieldDefaults.labelWidth - 100;
+ }
Ext.applyIf(me, {
modal: true,
layout: 'auto',
width: me.column2 ? colwidth*2 : colwidth,
border: false,
- items: formpanel,
+ items: [ formpanel ],
buttons: me.create ? [ submitBtn ] : [ submitBtn, resetBtn ]
});
Modified: pve-manager/pve2/www/manager/window/LoginWindow.js
===================================================================
--- pve-manager/pve2/www/manager/window/LoginWindow.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/window/LoginWindow.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -50,7 +50,7 @@
fieldDefaults: {
labelWidth: 70,
- labelAlign : 'right',
+ labelAlign : 'right'
},
defaults: {
Modified: pve-manager/pve2/www/manager/window/TaskViewer.js
===================================================================
--- pve-manager/pve2/www/manager/window/TaskViewer.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/window/TaskViewer.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -1,3 +1,6 @@
+// fixme: how can we avoid those lint errors?
+/*jslint confusion: true */
+
Ext.define('PVE.window.TaskViewer', {
extend: 'Ext.window.Window',
requires: [
@@ -8,8 +11,9 @@
initComponent: function() {
var me = this;
- if (!me.upid)
+ if (!me.upid) {
throw "no task specified";
+ }
var task = PVE.Utils.parse_task_upid(me.upid);
@@ -45,7 +49,7 @@
};
var store = Ext.create('Ext.data.Store', {
- model: 'pve-string-list',
+ model: 'pve-string-list',
pageSize: 200,
buffered: true,
proxy: {
@@ -59,7 +63,7 @@
var statstore = Ext.create('PVE.data.ObjectStore', {
url: "/api2/json/nodes/" + task.node + "/tasks/" + me.upid + "/status",
interval: 1000,
- rows: rows,
+ rows: rows
});
me.on('destroy', statstore.stopUpdate);
@@ -83,6 +87,7 @@
disabled: true,
handler: stop_task
});
+
var stop_btn2 = new Ext.Button({
text: 'Stop',
disabled: true,
@@ -100,8 +105,9 @@
me.mon(statstore, 'load', function() {
var status = statgrid.getObjectValue('status');
- if (status === 'stopped')
- statstore.stopUpdate();
+ if (status === 'stopped') {
+ statstore.stopUpdate();
+ }
stop_btn1.setDisabled(status !== 'running');
stop_btn2.setDisabled(status !== 'running');
Modified: pve-manager/pve2/www/manager/window/Wizard.js
===================================================================
--- pve-manager/pve2/www/manager/window/Wizard.js 2011-07-08 10:23:43 UTC (rev 6272)
+++ pve-manager/pve2/www/manager/window/Wizard.js 2011-07-08 10:35:46 UTC (rev 6273)
@@ -8,8 +8,9 @@
getValues: function(dirtyOnly) {
var me = this;
- if (Ext.isFunction(me.onGetValues))
+ if (Ext.isFunction(me.onGetValues)) {
dirtyOnly = false;
+ }
var values = {};
@@ -19,8 +20,9 @@
}
});
- if (Ext.isFunction(me.onGetValues))
+ if (Ext.isFunction(me.onGetValues)) {
return me.onGetValues(values, dirtyOnly);
+ }
return values;
},
@@ -55,7 +57,7 @@
}
];
} else {
- throw "unsupported config"
+ throw "unsupported config";
}
Ext.apply(me, {
@@ -116,12 +118,14 @@
var valid = true;
var fields = card.query('field, fieldcontainer');
Ext.Array.each(fields, function(field) {
- if (!field.isValid())
+ if (!field.isValid()) {
valid = false;
+ }
});
- if (Ext.isFunction(card.validator))
+ if (Ext.isFunction(card.validator)) {
return card.validator();
+ }
return valid;
};
@@ -164,8 +168,9 @@
var tp = me.down('#wizcontent');
var atab = tp.getActiveTab();
- if (!check_card(atab))
+ if (!check_card(atab)) {
return;
+ }
var next = tp.items.indexOf(atab) + 1;
var ntab = tp.items.getAt(next);
@@ -192,9 +197,9 @@
var display_header = function(newcard) {
var html = '<h1>' + newcard.title + '</h1>';
- if (newcard.descr)
+ if (newcard.descr) {
html += newcard.descr;
-
+ }
me.down('#header').update(html);
};
@@ -203,8 +208,9 @@
var idx = tp.items.indexOf(card);
for(;idx < tp.items.getCount();idx++) {
var nc = tp.items.getAt(idx);
- if (nc)
+ if (nc) {
nc.disable();
+ }
}
};
@@ -263,12 +269,12 @@
labelWidth: 100,
anchor: '100%'
},
- items: {
+ items: [{
itemId: 'wizcontent',
xtype: 'tabpanel',
activeItem: 0,
bodyPadding: 10,
- listeners: {
+ listeners: {
afterrender: function(tp) {
var atab = this.getActiveTab();
tabchange(tp, atab);
@@ -279,7 +285,7 @@
}
},
items: tabs
- }
+ }]
},
tbar
]
More information about the pve-devel
mailing list