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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-25 18:32:00 +02:00
parent 5e80efaeea
commit f138d11f0d

View File

@ -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;
}
}