diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 14:53:38 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 14:53:38 +0200 |
| commit | b9e1806c97dba043af5b20c78ba2be9bbf47b4d8 (patch) | |
| tree | 0a3f342c41ef07a09ca26909bf376ff63943e8de /app/client/dashboard | |
| parent | 79fa74e5fe24e4f22487213c917fab0a38c7ba2a (diff) | |
list morphs
Diffstat (limited to 'app/client/dashboard')
| -rw-r--r-- | app/client/dashboard/dashboard.actions.js | 4 | ||||
| -rw-r--r-- | app/client/dashboard/dashboard.component.js | 33 |
2 files changed, 23 insertions, 14 deletions
diff --git a/app/client/dashboard/dashboard.actions.js b/app/client/dashboard/dashboard.actions.js index ae54f02..2757830 100644 --- a/app/client/dashboard/dashboard.actions.js +++ b/app/client/dashboard/dashboard.actions.js @@ -8,11 +8,12 @@ export const load = () => (dispatch) => { actions.folder.index({ activity: 'dataset', }), actions.file.index({ module: 'samplernn', generated: 1, limit: 15, orderBy: 'created_at desc', }), 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) dispatch({ type: types.app.load_progress, progress: { i, n }}) }).then(res => { - const [ tasks, folders, samplernn, pix2pixhd ] = res + const [ tasks, folders, samplernn, pix2pixhd, morph ] = res const { mapFn, sortFn } = util.sort.orderByFn('date desc') const foldersByModule = folders.map(mapFn).sort(sortFn).reduce((a,b) => { const module = b[1].module @@ -28,6 +29,7 @@ export const load = () => (dispatch) => { renders: { samplernn, pix2pixhd, + morph, }, foldersByModule, }, diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js index 58795ee..ac060de 100644 --- a/app/client/dashboard/dashboard.component.js +++ b/app/client/dashboard/dashboard.component.js @@ -33,15 +33,18 @@ class Dashboard extends Component { const { site, foldersByModule, renders, queue, images } = this.props const { tasks } = queue const folders = foldersByModule && Object.keys(modules).sort().map(key => { - if (! foldersByModule[key]) return null - const path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/' - const folders = foldersByModule[key].map(folder => { - return ( - <div key={folder.id}> - <Link to={path + folder.id + '/'}>{folder.name}</Link> - </div> - ) - }) + 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 files = renders[key] && ( <FileList linkFiles @@ -61,10 +64,14 @@ class Dashboard extends Component { <div className='dashboardModule' key={key}> <div className='row moduleHeading'> <h3>{key}</h3> - <div> - <Link to={'/' + key + '/new/'}>new</Link> - </div> - {folders} + {folder_list && + <span> + <div> + <Link to={'/' + key + '/new/'}>new</Link> + </div> + {folders} + </span> + } </div> {files} </div> |
