]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/data/ProxmoxProxy.js
ProxmoxProxy: add duration fields for proxmox-tasks
[proxmox-widget-toolkit.git] / src / data / ProxmoxProxy.js
index 53e92f3126d38c0f73613550122b97911763c3ba..7df8f286aef32e26d34326523f5d8f4074080ac6 100644 (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',