From 932fe9ccb9bfad7f454c5f53d35ec06c27328281 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 30 Jun 2018 19:12:58 +0200 Subject: fixing up dashboard --- app/client/dashboard/dashboardHeader.component.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 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 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 (

{site.name} cortex

- {this.renderGPUStatus()} + {this.renderStatus("GPU", runner.gpu)} + {this.renderStatus("CPU", runner.cpu)}
) } - renderGPUStatus(){ - const { runner } = this.props - const gpu = runner.cpu + renderStatus(name, gpu){ + console.log(gpu) if (gpu.status === 'IDLE') { - return null + return
{name} idle
} 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 (
- Currently running {task.module} live on "{task.dataset}" + {name} running {task.module} live on "{task.dataset}"
) } else { return (
- Currently {util.gerund(task.activity)} {task.module} on {task.dataset}
- {eta && Epoch: {task.epoch} / {task.epochs}, ETA {eta}
} + {name} {util.gerund(task.activity)} {task.module} on {task.dataset} + {!!task.epoch && Epoch: {task.epoch} / {task.epochs}
}
) } } } -// Want to play live? const mapStateToProps = state => ({ runner: state.system.runner, -- cgit v1.2.3-70-g09d2