From f138d11f0dba08fff2879c090b5ac88085bfeb65 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 25 May 2020 18:32:00 +0200 Subject: [PATCH] ui: task history: handle running tasks normally this is used as strict task history, meaning no running tasks included. But we can have running tasks in PBS here, so at least avoid that they're shown as error. Also add a refresh button as a simple workaround to the auto-refresh problem, which isn't straightforward to solve with the buffered reader we have here. Signed-off-by: Thomas Lamprecht --- node/Tasks.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/node/Tasks.js b/node/Tasks.js index bc39c6a..d9945fa 100644 --- a/node/Tasks.js +++ b/node/Tasks.js @@ -87,7 +87,14 @@ Ext.define('Proxmox.node.Tasks', { } }, tbar: [ - view_btn, '->', gettext('User name') +':', ' ', + view_btn, + { + text: gettext('Refresh'), // FIXME: smart-auto-refresh store + handler: () => store.reload(), + }, + '->', + gettext('User name') +':', + ' ', { xtype: 'textfield', width: 200, @@ -126,7 +133,11 @@ Ext.define('Proxmox.node.Tasks', { dataIndex: 'endtime', width: 100, renderer: function(value, metaData, record) { - return Ext.Date.format(value,"M d H:i:s"); + if (!value) { + metaData.tdCls = "x-grid-row-loading"; + return ''; + } + return Ext.Date.format(value, "M d H:i:s"); } }, { @@ -153,7 +164,10 @@ Ext.define('Proxmox.node.Tasks', { if (value == 'OK') { return 'OK'; } - // metaData.attr = 'style="color:red;"'; + if (value === undefined && !record.data.endtime) { + metaData.tdCls = "x-grid-row-loading"; + return ''; + } return "ERROR: " + value; } }