From 5a4de48a6d63cb383832f6ef85b21699a511b755 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 25 May 2018 19:54:38 +0200 Subject: stubbing in a lot of stuff! --- app/client/dashboard/tasklist.component.js | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/client/dashboard/tasklist.component.js (limited to 'app/client/dashboard/tasklist.component.js') diff --git a/app/client/dashboard/tasklist.component.js b/app/client/dashboard/tasklist.component.js new file mode 100644 index 0000000..fa002de --- /dev/null +++ b/app/client/dashboard/tasklist.component.js @@ -0,0 +1,45 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +class TaskList extends Component { + constructor(props){ + super() + } + render(){ + const { title, tasks } = this.props + let time = 0 + const taskList = tasks.map(task => { + const eta = (time + (task.epochs) * 180 / 60) + " min." + time += (task.epochs) * 180 / 60 + let dataset_type, dataset_name + if (task.dataset.indexOf('/') !== -1) { + [dataset_type, dataset_name] = task.dataset.split('/') + } else { + dataset_name = task.dataset + } + return ( +
+
{task.activity} {task.library} {dataset_type}
+
{dataset_name}
+
{task.epochs} ep.
+
{eta}
+
+ ) + }) + return ( +
+ {taskList} +
+ ) + } +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(TaskList) -- cgit v1.2.3-70-g09d2