]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
panel: disks: more static task window creation
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 2 Jun 2021 14:26:43 +0000 (16:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 2 Jun 2021 14:26:54 +0000 (16:26 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/panel/DiskList.js

index b1551394e40a371c281a6f6170f4482031ae663f..90a655344270d085a61e18eeb8e54697128d0c35 100644 (file)
@@ -99,18 +99,15 @@ Ext.define('Proxmox.DiskList', {
                waitMsgTarget: view,
                method: 'POST',
                params: { disk: rec.data.name },
-               failure: function(response, options) {
-                   Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-               },
+               failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
                success: function(response, options) {
-                   var upid = response.result.data;
-                   var win = Ext.create('Proxmox.window.TaskProgress', {
-                       upid: upid,
+                   Ext.create('Proxmox.window.TaskProgress', {
+                       upid: response.result.data,
                        taskDone: function() {
                            me.reload();
                        },
+                       autoShow: true,
                    });
-                   win.show();
                },
            });
        },
@@ -127,18 +124,15 @@ Ext.define('Proxmox.DiskList', {
                waitMsgTarget: view,
                method: 'PUT',
                params: { disk: rec.data.name },
-               failure: function(response, options) {
-                   Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-               },
+               failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
                success: function(response, options) {
-                   var upid = response.result.data;
-                   var win = Ext.create('Proxmox.window.TaskProgress', {
-                       upid: upid,
+                   Ext.create('Proxmox.window.TaskProgress', {
+                       upid: response.result.data,
                        taskDone: function() {
                            me.reload();
                        },
+                       autoShow: true,
                    });
-                   win.show();
                },
            });
        },