node tasks: add duration column, hide by default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-09-29 10:15:41 +02:00
parent 8e3f2973a8
commit 54dc3ab4de

View 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',