ProxmoxProxy: add duration fields for proxmox-tasks

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-15 16:07:08 +02:00 committed by Thomas Lamprecht
parent 82327aca09
commit 66be1b8ac1

View File

@ -43,6 +43,18 @@ Ext.define('Proxmox.RestProxy', {
{ name: 'starttime', type: 'date', dateFormat: 'timestamp' },
{ name: 'endtime', type: 'date', dateFormat: 'timestamp' },
{ name: 'pid', type: 'int' },
{
name: 'duration',
sortType: 'asInt',
calculate: function(data) {
let endtime = data.endtime;
let starttime = data.starttime;
if (endtime !== undefined) {
return (endtime - starttime)/1000;
}
return 0;
},
},
'node', 'upid', 'user', 'status', 'type', 'id',
],
idProperty: 'upid',