diff options
Diffstat (limited to 'app/client/dashboard/dashboardHeader.component.js')
| -rw-r--r-- | app/client/dashboard/dashboardHeader.component.js | 36 |
1 files changed, 30 insertions, 6 deletions
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 ( <div class='dashboardHeader heading'> <h3>{site.name}</h3> - Currently {util.gerund(currentTask.activity)} {currentTask.module} on {currentTask.dataset}<br/> - Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}<br/> - <br/> - Want to play live? <button>Pause at the end of this epoch</button> + {this.renderGPUStatus()} </div> ) } + 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 ( + <div> + Currently running {task.module} live on "{task.dataset}" + </div> + ) + } + else { + return ( + <div> + Currently {util.gerund(task.activity)} {task.module} on {task.dataset}<br/> + Epoch: {task.epoch} / {task.epochs}, ETA {eta}<br/> + <br /> + Want to play live? <button>Pause at the end of this epoch</button> + </div> + ) + } + } } const mapStateToProps = state => ({ + runner: state.system.runner, currentTask: state.task.currentTask, site: state.system.site, }) |
