mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 19:41:44 +00:00
add showProgress to SafeDestroy
modeled after the mechanism used in window/Edit.js Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
cb852a4dcd
commit
707c28ce80
@ -13,6 +13,7 @@ Ext.define('PVE.window.SafeDestroy', {
|
|||||||
width: 450,
|
width: 450,
|
||||||
layout: { type:'hbox' },
|
layout: { type:'hbox' },
|
||||||
defaultFocus: 'confirmField',
|
defaultFocus: 'confirmField',
|
||||||
|
showProgress: false,
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
item: {
|
item: {
|
||||||
@ -61,11 +62,32 @@ Ext.define('PVE.window.SafeDestroy', {
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
waitMsgTarget: view,
|
waitMsgTarget: view,
|
||||||
failure: function(response, opts) {
|
failure: function(response, opts) {
|
||||||
|
view.close();
|
||||||
Ext.Msg.alert('Error', response.htmlStatus);
|
Ext.Msg.alert('Error', response.htmlStatus);
|
||||||
},
|
},
|
||||||
callback: function() {
|
success: function(response, options) {
|
||||||
|
var hasProgressBar = view.showProgress &&
|
||||||
|
response.result.data ? true : false;
|
||||||
|
|
||||||
|
if (hasProgressBar) {
|
||||||
|
// stay around so we can trigger our close events
|
||||||
|
// when background action is completed
|
||||||
|
view.hide();
|
||||||
|
|
||||||
|
var upid = response.result.data;
|
||||||
|
var win = Ext.create('PVE.window.TaskProgress', {
|
||||||
|
upid: upid,
|
||||||
|
listeners: {
|
||||||
|
destroy: function () {
|
||||||
view.close();
|
view.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
win.show();
|
||||||
|
} else {
|
||||||
|
view.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user