From d41070c7b00fafc974a1a6e7b6d1b42391fa57ed Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 21 Jul 2017 04:48:52 +0200 Subject: all async paths working --- client/components/Tasks/TaskListView.jsx | 41 ++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'client/components/Tasks/TaskListView.jsx') diff --git a/client/components/Tasks/TaskListView.jsx b/client/components/Tasks/TaskListView.jsx index 47be794..b93ecc3 100644 --- a/client/components/Tasks/TaskListView.jsx +++ b/client/components/Tasks/TaskListView.jsx @@ -1,24 +1,51 @@ import { h, Component } from 'preact' +import format from '../../vendor/format.js' import FileLink from '../../containers/fileLink.js' export default function TaskListView (props) { const tasks = (props.tasks || []).map( (task, i) => { - return ( -
- {task.id} - {task.created_at} + const created_at = format.verboseDate(task.created_at) + let files = [] + let cancel + if (task.content_file) { + files.push( + ) + } + if (task.style_file) { + files.push( - α={task.alpha} - + ) + } + if (! task.output_file && ! task.processing) { + cancel = ( + props.cancelTask(task)}>x + ) + } + const completed = task.completed ? 'completed' : '' + let filename = task.output_file ? task.output_file.name : + task.processing ? '(processing)' : '(waiting)' + return ( +
+
+ {created_at.date} + {created_at.time} + {filename} + {cancel} +
+
+ α={task.alpha} + {files} +
) // {task.result_file.name} }) return ( -
+
{tasks}
) } + -- cgit v1.2.3-70-g09d2