[pve-devel] r6345 - in pve-manager/pve2: . www/manager www/manager/qemu www/manager/window
svn-commits at proxmox.com
svn-commits at proxmox.com
Thu Jul 21 13:26:43 CEST 2011
Author: dietmar
Date: 2011-07-21 13:26:43 +0200 (Thu, 21 Jul 2011)
New Revision: 6345
Modified:
pve-manager/pve2/ChangeLog
pve-manager/pve2/www/manager/Utils.js
pve-manager/pve2/www/manager/qemu/CreateWizard.js
pve-manager/pve2/www/manager/qemu/HardwareView.js
pve-manager/pve2/www/manager/qemu/NotesView.js
pve-manager/pve2/www/manager/qemu/Summary.js
pve-manager/pve2/www/manager/window/Edit.js
pve-manager/pve2/www/manager/window/TaskViewer.js
Log:
* www/manager/Utils.js (API2Request): improved waitMsgTarget
option - we need to pass a component (to make it work when the
components is not renedered).
Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/ChangeLog 2011-07-21 11:26:43 UTC (rev 6345)
@@ -1,5 +1,9 @@
2011-07-21 Proxmox Support Team <support at proxmox.com>
+ * www/manager/Utils.js (API2Request): improved waitMsgTarget
+ option - we need to pass a component (to make it work when the
+ components is not renedered).
+
* www/manager/storage/NFSEdit.js: impl.
* www/manager/Utils.js: new waitMsgTarget option (mask el), better
Modified: pve-manager/pve2/www/manager/Utils.js
===================================================================
--- pve-manager/pve2/www/manager/Utils.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/Utils.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -262,7 +262,7 @@
Ext.apply(newopts, {
success: function(response, options) {
if (options.waitMsgTarget) {
- options.waitMsgTarget.unmask();
+ options.waitMsgTarget.setLoading(false);
}
var result = Ext.decode(response.responseText);
response.result = result;
@@ -277,7 +277,7 @@
},
failure: function(response, options) {
if (options.waitMsgTarget) {
- options.waitMsgTarget.unmask();
+ options.waitMsgTarget.setLoading(false);
}
var result = Ext.decode(response.responseText);
response.result = result || {};
@@ -298,8 +298,16 @@
createWrapper(reqOpts.success, reqOpts.callback, reqOpts.failure);
- if (newopts.waitMsgTarget) {
- newopts.waitMsgTarget.mask(newopts.waitMsg, 'x-mask-loading');
+ var target = newopts.waitMsgTarget;
+ if (target) {
+ if (target.rendered) {
+ target.setLoading(newopts.waitMsg, true);
+ } else {
+ // hack: extjs should do that for us
+ target.on('afterlayout', function() {
+ target.setLoading(newopts.waitMsg, true);
+ });
+ }
}
Ext.Ajax.request(newopts);
},
Modified: pve-manager/pve2/www/manager/qemu/CreateWizard.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/CreateWizard.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/qemu/CreateWizard.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -150,7 +150,7 @@
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu',
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
method: 'POST',
params: kv,
success: function(response){
Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -209,7 +209,7 @@
}
PVE.Utils.API2Request({
url: '/api2/extjs/' + baseurl,
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
method: 'PUT',
params: {
'delete': rec.data.key
Modified: pve-manager/pve2/www/manager/qemu/NotesView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/NotesView.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/qemu/NotesView.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -6,7 +6,7 @@
PVE.Utils.API2Request({
url: me.url,
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
failure: function(response, opts) {
me.update("Error " + response.htmlStatus);
},
Modified: pve-manager/pve2/www/manager/qemu/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/Summary.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/qemu/Summary.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -29,7 +29,7 @@
PVE.Utils.API2Request({
params: { command: cmd },
url: '/nodes/' + nodename + '/qemu/' + vmid + "/status",
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
method: 'PUT',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
@@ -98,7 +98,7 @@
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu/' + vmid,
method: 'DELETE',
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
}
Modified: pve-manager/pve2/www/manager/window/Edit.js
===================================================================
--- pve-manager/pve2/www/manager/window/Edit.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/window/Edit.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -68,7 +68,7 @@
PVE.Utils.API2Request({
url: me.url,
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
method: me.method || 'PUT',
params: values,
failure: function(response, options) {
@@ -91,7 +91,7 @@
options = options || {};
var newopts = Ext.apply({
- waitMsgTarget: me.getTargetEl()
+ waitMsgTarget: me
}, options);
var createWrapper = function(successFn) {
Modified: pve-manager/pve2/www/manager/window/TaskViewer.js
===================================================================
--- pve-manager/pve2/www/manager/window/TaskViewer.js 2011-07-21 10:39:48 UTC (rev 6344)
+++ pve-manager/pve2/www/manager/window/TaskViewer.js 2011-07-21 11:26:43 UTC (rev 6345)
@@ -71,7 +71,7 @@
var stop_task = function() {
PVE.Utils.API2Request({
url: "/nodes/" + task.node + "/tasks/" + me.upid,
- waitMsgTarget: me.getTargetEl(),
+ waitMsgTarget: me,
method: 'DELETE',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
More information about the pve-devel
mailing list