mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-10-04 14:50:44 +00:00
ui: qemu: hardware: use background delay for asynchronous remove tasks
Avoids spawning a progress window for tasks that do complete more quickly than the background delay. Currently, the remove task is only asynchronous (i.e. using POST) when it's for an unused disk, but this might change in the future (e.g. for hot-unplug). When adding a disk, a background delay of 5 seconds is already used. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
faa83925c9
commit
3dba293d78
@ -486,17 +486,19 @@ Ext.define('PVE.qemu.HardwareView', {
|
||||
return msg;
|
||||
},
|
||||
handler: function(btn, e, rec) {
|
||||
let params = { 'delete': rec.data.key };
|
||||
if (btn.RESTMethod === 'POST') {
|
||||
params.background_delay = 5;
|
||||
}
|
||||
Proxmox.Utils.API2Request({
|
||||
url: '/api2/extjs/' + baseurl,
|
||||
waitMsgTarget: me,
|
||||
method: btn.RESTMethod,
|
||||
params: {
|
||||
'delete': rec.data.key,
|
||||
},
|
||||
params: params,
|
||||
callback: () => me.reload(),
|
||||
failure: response => Ext.Msg.alert('Error', response.htmlStatus),
|
||||
success: function(response, options) {
|
||||
if (btn.RESTMethod === 'POST') {
|
||||
if (btn.RESTMethod === 'POST' && response.result.data !== null) {
|
||||
Ext.create('Proxmox.window.TaskProgress', {
|
||||
autoShow: true,
|
||||
upid: response.result.data,
|
||||
|
Loading…
Reference in New Issue
Block a user