Commit 17e9df7d authored by Thomas Lamprecht's avatar Thomas Lamprecht Committed by Dietmar Maurer

better formating and UI of task viewer and task list

[TaskList]:
* format task date on the same node as the title. If space isn't
  there, the date goes on it's own line.
* Truncate output of task status to a maximum of 160 characters to
  fix formating, also the list should only give an overview.
* set list flex to 1, this fixes height and scrolling issues
* Put affected node and status on a own line.

[TaskViewer]
* Only show task status, the exit status is in the log below,
  also some long statuses break this page completely.
Signed-off-by: 's avatarThomas Lamprecht <t.lamprecht@proxmox.com>
parent 78fbaa2e
...@@ -9,8 +9,7 @@ Ext.define('PVE.TaskListBase', { ...@@ -9,8 +9,7 @@ Ext.define('PVE.TaskListBase', {
}, },
{ {
xtype: 'list', xtype: 'list',
//flex: 1, flex: 1,
height: 800,
disableSelection: true, disableSelection: true,
listeners: { listeners: {
itemsingletap: function(list, index, target, record) { itemsingletap: function(list, index, target, record) {
...@@ -19,12 +18,18 @@ Ext.define('PVE.TaskListBase', { ...@@ -19,12 +18,18 @@ Ext.define('PVE.TaskListBase', {
} }
}, },
itemTpl: [ itemTpl: [
'<small>{starttime:date("M d H:i:s")} - {endtime:date("M d H:i:s")}</small><br>', '<div style="vertical-align: middle;">' +
'{[this.desc(values)]}<br>', '<span>{[this.desc(values)]}</span>',
'<small>node: {node} Status: {status}</small>', '<span style=" font-size:small; float: right;">' +
'{starttime:date("M d H:i:s")} - {endtime:date("H:i:s")}' +
'</span></div>',
'<small>node: {node}<br /> Status: {[this.status(values)]}</small>',
{ {
desc: function(values) { desc: function(values) {
return PVE.Utils.format_task_description(values.type, values.id); return PVE.Utils.format_task_description(values.type, values.id);
},
status: function(values) {
return Ext.String.ellipsis(values.status, 160);
} }
} }
] ]
...@@ -74,7 +79,7 @@ Ext.define('PVE.ClusterTaskList', { ...@@ -74,7 +79,7 @@ Ext.define('PVE.ClusterTaskList', {
}, },
config: { config: {
baseUrl: '/cluster/tasks', baseUrl: '/cluster/tasks'
}, },
initialize: function() { initialize: function() {
......
...@@ -89,7 +89,7 @@ Ext.define('PVE.TaskViewer', { ...@@ -89,7 +89,7 @@ Ext.define('PVE.TaskViewer', {
var d = response.result.data; var d = response.result.data;
var kv = []; var kv = [];
kv.push({ key: gettext('Status'), value: d.exitstatus || d.status }); kv.push({ key: gettext('Taskstatus'), value: d.status });
kv.push({ key: gettext('Node'), value: d.node }); kv.push({ key: gettext('Node'), value: d.node });
kv.push({ key: gettext('User'), value: d.user }); kv.push({ key: gettext('User'), value: d.user });
kv.push({ key: gettext('Starttime'), value: PVE.Utils.render_timestamp(d.starttime) }); kv.push({ key: gettext('Starttime'), value: PVE.Utils.render_timestamp(d.starttime) });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment