summaryrefslogtreecommitdiff
path: root/app/client/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/dashboard')
-rw-r--r--app/client/dashboard/dashboard.actions.js5
-rw-r--r--app/client/dashboard/dashboard.component.js32
-rw-r--r--app/client/dashboard/dashboardHeader.component.js22
3 files changed, 24 insertions, 35 deletions
diff --git a/app/client/dashboard/dashboard.actions.js b/app/client/dashboard/dashboard.actions.js
index 2757830..8b5502a 100644
--- a/app/client/dashboard/dashboard.actions.js
+++ b/app/client/dashboard/dashboard.actions.js
@@ -10,7 +10,7 @@ export const load = () => (dispatch) => {
actions.file.index({ module: 'pix2pixhd', generated: 1, limit: 15, orderBy: 'created_at desc', }),
actions.file.index({ module: 'morph', generated: 1, limit: 15, orderBy: 'created_at desc', }),
], (percent, i, n) => {
- console.log('dashboard load progress', i, n)
+ // console.log('dashboard load progress', i, n)
dispatch({ type: types.app.load_progress, progress: { i, n }})
}).then(res => {
const [ tasks, folders, samplernn, pix2pixhd, morph ] = res
@@ -26,14 +26,13 @@ export const load = () => (dispatch) => {
data: {
tasks,
folders,
+ foldersByModule,
renders: {
samplernn,
pix2pixhd,
morph,
},
- foldersByModule,
},
})
-
})
}
diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js
index a75535f..3c9b2de 100644
--- a/app/client/dashboard/dashboard.component.js
+++ b/app/client/dashboard/dashboard.component.js
@@ -32,18 +32,16 @@ class Dashboard extends Component {
render(){
const { site, foldersByModule, renders, queue, images } = this.props
const { tasks } = queue
+ console.log(foldersByModule)
const folders = foldersByModule && Object.keys(modules).sort().map(key => {
- let path, folder_list
- if (foldersByModule[key]) {
- path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/'
- folder_list = foldersByModule[key].map(folder => {
- return (
- <div key={folder.id}>
- <Link to={path + folder.id + '/'}>{folder.name}</Link>
- </div>
- )
- })
- }
+ let path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/'
+ let folder_list = (foldersByModule[key] || []).map(folder => {
+ return (
+ <div key={folder.id}>
+ <Link to={path + folder.id + '/'}>{folder.name}</Link>
+ </div>
+ )
+ })
let files = renders[key] && (
<FileList
@@ -64,14 +62,10 @@ class Dashboard extends Component {
<div className='dashboardModule' key={key}>
<div className='row moduleHeading'>
<h3>{key}</h3>
- {folder_list &&
- <span>
- <div>
- <Link to={'/' + key + '/new/'}>new</Link>
- </div>
- {folders}
- </span>
- }
+ <div>
+ <Link to={'/' + key + '/new/'}>new</Link>
+ </div>
+ {folder_list}
</div>
{files}
</div>
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,