]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
node tasks: add duration column, hide by default
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Sep 2020 08:15:41 +0000 (10:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Sep 2020 08:15:41 +0000 (10:15 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/node/Tasks.js

index 2d8730050fc768b981ed22d88b35ead584e4c627..1f01b0746019d3c2b8da1646b0594e94936bdbb3 100644 (file)
@@ -155,6 +155,23 @@ Ext.define('Proxmox.node.Tasks', {
                        return Ext.Date.format(value, "M d H:i:s");
                    },
                },
+               {
+                   header: gettext("Duration"),
+                   hidden: true,
+                   width: 80,
+                   renderer: function(value, metaData, record) {
+                       let start = record.data.starttime;
+                       if (start) {
+                           let end = record.data.endtime || Date.now();
+                           let duration = end - start;
+                           if (duration > 0) {
+                               duration /= 1000;
+                           }
+                           return Proxmox.Utils.format_duration_human(duration);
+                       }
+                       return Proxmox.Utils.unknownText;
+                   },
+               },
                {
                    header: gettext("Node"),
                    dataIndex: 'node',