[pve-devel] [PATCH widget-toolkit v2 1/4] ProxmoxProxy: add duration fields for proxmox-tasks
Dominik Csapak
d.csapak at proxmox.com
Mon Jun 15 16:07:08 CEST 2020
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* do not truncate the decimal places
src/data/ProxmoxProxy.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/data/ProxmoxProxy.js b/src/data/ProxmoxProxy.js
index 53e92f3..7df8f28 100644
--- a/src/data/ProxmoxProxy.js
+++ b/src/data/ProxmoxProxy.js
@@ -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',
--
2.20.1
More information about the pve-devel
mailing list