From b981d33e6f18b4d91688f376528aeec9388e9d27 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 23 Sep 2015 17:54:46 +0200 Subject: [PATCH] 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: Thomas Lamprecht --- www/mobile/TaskList.js | 17 +++++++++++------ www/mobile/TaskViewer.js | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/www/mobile/TaskList.js b/www/mobile/TaskList.js index dccb5a0f..3d0f7112 100644 --- a/www/mobile/TaskList.js +++ b/www/mobile/TaskList.js @@ -9,8 +9,7 @@ Ext.define('PVE.TaskListBase', { }, { xtype: 'list', - //flex: 1, - height: 800, + flex: 1, disableSelection: true, listeners: { itemsingletap: function(list, index, target, record) { @@ -19,12 +18,18 @@ Ext.define('PVE.TaskListBase', { } }, itemTpl: [ - '{starttime:date("M d H:i:s")} - {endtime:date("M d H:i:s")}
', - '{[this.desc(values)]}
', - 'node: {node} Status: {status}', + '
' + + '{[this.desc(values)]}', + '' + + '{starttime:date("M d H:i:s")} - {endtime:date("H:i:s")}' + + '
', + 'node: {node}
Status: {[this.status(values)]}
', { desc: function(values) { 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', { }, config: { - baseUrl: '/cluster/tasks', + baseUrl: '/cluster/tasks' }, initialize: function() { diff --git a/www/mobile/TaskViewer.js b/www/mobile/TaskViewer.js index 1e6143c5..a66f7085 100644 --- a/www/mobile/TaskViewer.js +++ b/www/mobile/TaskViewer.js @@ -89,7 +89,7 @@ Ext.define('PVE.TaskViewer', { var d = response.result.data; 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('User'), value: d.user }); kv.push({ key: gettext('Starttime'), value: PVE.Utils.render_timestamp(d.starttime) });