From 964ac7009e6db5a06233bdc07fa63778eebf2db7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 1 Jun 2018 03:30:39 +0200 Subject: async commands!! --- app/client/dashboard/dashboardHeader.component.js | 36 +++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'app/client/dashboard/dashboardHeader.component.js') diff --git a/app/client/dashboard/dashboardHeader.component.js b/app/client/dashboard/dashboardHeader.component.js index 2e53088..701c97a 100644 --- a/app/client/dashboard/dashboardHeader.component.js +++ b/app/client/dashboard/dashboardHeader.component.js @@ -13,21 +13,45 @@ class DashboardHeader extends Component { this.props.onClick && this.props.onClick() } render() { - const { currentTask, site } = this.props - const eta = ((currentTask.epochs - currentTask.epoch) * 180 / 60) + " minutes" + const { site } = this.props return (

{site.name}

- Currently {util.gerund(currentTask.activity)} {currentTask.module} on {currentTask.dataset}
- Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}
-
- Want to play live? + {this.renderGPUStatus()}
) } + renderGPUStatus(){ + const { runner } = this.props + const gpu = runner.cpu + if (gpu.status === 'IDLE') { + return null + } + const task = gpu.task + const eta = ((task.epochs - (task.epoch || 0)) * 180 / 60) + " minutes" + let activityPhrase, liveMessage + if (task.activity === 'live') { + return ( +
+ Currently running {task.module} live on "{task.dataset}" +
+ ) + } + else { + return ( +
+ Currently {util.gerund(task.activity)} {task.module} on {task.dataset}
+ Epoch: {task.epoch} / {task.epochs}, ETA {eta}
+
+ Want to play live? +
+ ) + } + } } const mapStateToProps = state => ({ + runner: state.system.runner, currentTask: state.task.currentTask, site: state.system.site, }) -- cgit v1.2.3-70-g09d2