diff options
Diffstat (limited to 'app/client/dashboard/dashboardHeader.component.js')
| -rw-r--r-- | app/client/dashboard/dashboardHeader.component.js | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/app/client/dashboard/dashboardHeader.component.js b/app/client/dashboard/dashboardHeader.component.js index 10b2241..5f1306c 100644 --- a/app/client/dashboard/dashboardHeader.component.js +++ b/app/client/dashboard/dashboardHeader.component.js @@ -13,43 +13,39 @@ class DashboardHeader extends Component { this.props.onClick && this.props.onClick() } render() { - const { site } = this.props + const { site, runner } = this.props return ( <div class='dashboardHeader heading'> <h1>{site.name} cortex</h1> - {this.renderGPUStatus()} + {this.renderStatus("GPU", runner.gpu)} + {this.renderStatus("CPU", runner.cpu)} </div> ) } - renderGPUStatus(){ - const { runner } = this.props - const gpu = runner.cpu + renderStatus(name, gpu){ + console.log(gpu) if (gpu.status === 'IDLE') { - return null + return <div>{name} idle</div> } const task = gpu.task - const eta = task.epoch - ? ((task.epochs - (task.epoch || 0)) * 1000 / 60) + " minutes" - : null let activityPhrase, liveMessage if (task.activity === 'live') { return ( <div> - Currently running {task.module} live on "{task.dataset}" + {name} running <b>{task.module}</b> live on "{task.dataset}" </div> ) } else { return ( <div> - Currently {util.gerund(task.activity)} {task.module} on {task.dataset}<br/> - {eta && <span>Epoch: {task.epoch} / {task.epochs}, ETA {eta}<br/></span>} + {name} {util.gerund(task.activity)} <b>{task.module}</b> on <b>{task.dataset}</b> + {!!task.epoch && <span>Epoch: {task.epoch} / {task.epochs}<br/></span>} </div> ) } } } -// Want to play live? <button>Pause at the end of this epoch</button> const mapStateToProps = state => ({ runner: state.system.runner, |
