From 54dc3ab4de6a964ccc25209f8de9b06d1c5b8a3d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 29 Sep 2020 10:15:41 +0200 Subject: [PATCH] node tasks: add duration column, hide by default Signed-off-by: Thomas Lamprecht --- src/node/Tasks.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/node/Tasks.js b/src/node/Tasks.js index 2d87300..1f01b07 100644 --- a/src/node/Tasks.js +++ b/src/node/Tasks.js @@ -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', -- 2.39.2