]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
task viewer: modernize code style
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Jan 2023 13:43:33 +0000 (14:43 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Jan 2023 13:43:33 +0000 (14:43 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/window/TaskViewer.js

index e20e3b22c2d80208b6dd52c4f0eefa3fef62cbfe..3769a6d60d273ef01d33f382dcedcc06ac3020c4 100644 (file)
@@ -83,8 +83,6 @@ Ext.define('Proxmox.window.TaskProgress', {
     },
 });
 
-// fixme: how can we avoid those lint errors?
-
 Ext.define('Proxmox.window.TaskViewer', {
     extend: 'Ext.window.Window',
     alias: 'widget.proxmoxTaskViewer',
@@ -191,7 +189,7 @@ Ext.define('Proxmox.window.TaskViewer', {
        };
 
        let statstore = Ext.create('Proxmox.data.ObjectStore', {
-            url: "/api2/json/nodes/" + task.node + "/tasks/" + encodeURIComponent(me.upid) + "/status",
+            url: `/api2/json/nodes/${task.node}/tasks/${encodeURIComponent(me.upid)}/status`,
            interval: 1000,
            rows: rows,
        });
@@ -200,7 +198,7 @@ Ext.define('Proxmox.window.TaskViewer', {
 
        let stop_task = function() {
            Proxmox.Utils.API2Request({
-               url: "/nodes/" + task.node + "/tasks/" + encodeURIComponent(me.upid),
+               url: `/nodes/${task.node}/tasks/${encodeURIComponent(me.upid)}`,
                waitMsgTarget: me,
                method: 'DELETE',
                failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
@@ -231,12 +229,8 @@ Ext.define('Proxmox.window.TaskViewer', {
        let downloadBtn = new Ext.Button({
            text: gettext('Download'),
            iconCls: 'fa fa-download',
-           handler: function() {
-               let url = '/api2/extjs/nodes/' +
-                   `${task.node}/tasks/${encodeURIComponent(me.upid)}/log?download=1`;
-
-               Proxmox.Utils.downloadAsFile(url);
-           },
+           handler: () => Proxmox.Utils.downloadAsFile(
+               `/api2/json/nodes/${task.node}/tasks/${encodeURIComponent(me.upid)}/log?download=1`),
        });