diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-20 13:17:29 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-20 13:17:29 +0200 |
| commit | 79a13c20e1f2ce3f1838f500802d5355dce90446 (patch) | |
| tree | 310b541b77b2d24ab4a459df781612af88953938 /app/client/modules/pix2pixhd | |
| parent | f37392fe477d4656e12c4d5d18b4344d2c5ae8d6 (diff) | |
crazy..
Diffstat (limited to 'app/client/modules/pix2pixhd')
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.actions.js | 3 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.reducer.js | 6 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/pix2pixhd.results.js | 68 |
3 files changed, 52 insertions, 25 deletions
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.actions.js b/app/client/modules/pix2pixhd/pix2pixhd.actions.js index 1b22616..caf6b45 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.actions.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.actions.js @@ -140,7 +140,7 @@ export const load_results = (id) => (dispatch) => { console.log('hi') const module = pix2pixhdModule.name util.allProgress([ - actions.file.index({ module, generated: true }), + actions.file.index({ module, generated: 1 }), actions.socket.list_sequences({ module, dir: 'results' }), actions.socket.list_directory({ module, dir: 'renders' }), ], (percent, i, n) => { @@ -152,6 +152,7 @@ export const load_results = (id) => (dispatch) => { dispatch({ type: types.pix2pixhd.load_results, results: { + files, results, renders, } diff --git a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js index a21f4d5..b6264ed 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js @@ -7,6 +7,7 @@ const pix2pixhdInitialState = { error: null, folder_id: 0, data: null, + results: null, } const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => { @@ -15,6 +16,11 @@ const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => { } switch (action.type) { + case types.pix2pixhd.load_results: + return { + ...state, + results: action.results, + } default: return state } diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js index cf0bdf7..ac0bb74 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js @@ -16,37 +16,57 @@ class Pix2pixHDResults extends Component { if (!props.pix2pixhd.results) props.actions.load_results() } render(){ - if (this.props.pix2pixhd.loading) return <Loading progress={this.props.pix2pixhd.progress} /> - // const { folderLookup, fileLookup, datasetLookup } = this.props.samplernn.data - - // console.log(bestRenders.map(r => r.epoch)) - // const path = folder.name === 'unsorted' - // ? "/samplernn/import/" - // : "/samplernn/datasets/" + folder.id + "/" - // return ( - // <div className='col bestRenders'> - // <h3><Link to={path}>{folder.name}</Link></h3> - // <FileList - // linkFiles - // files={bestRenders} - // orderBy='date desc' - // fields={'name date epoch size'} - // onClick={(file, e) => { - // e.preventDefault() - // e.stopPropagation() - // console.log('picked a file', file) - // this.handlePick(file) - // }} - // /> - // </div> - // ) + if (! this.props.pix2pixhd.results) return <Loading progress={this.props.pix2pixhd.progress} /> + const { results, renders, files } = this.props.pix2pixhd.results +console.log(results) return ( <div className='app pix2pixhd'> <div className='heading row middle'> <h1>Pix2PixHD Results</h1> </div> <div class='rows params renders'> + + <h3>results</h3> + <FileList + files={results} + orderBy='date desc' + fields={'name date count'} + onClick={(file, e) => { + e.preventDefault() + e.stopPropagation() + console.log('picked a result', file) + this.handlePick(file) + }} + /> + + <h3>renders</h3> + <FileList + files={renders} + orderBy='date desc' + fields={'name date size'} + onClick={(file, e) => { + e.preventDefault() + e.stopPropagation() + console.log('picked a result', file) + this.handlePick(file) + }} + /> + + <h3>files</h3> + <FileList + linkFiles + files={files} + orderBy='date desc' + fields={'name date size'} + onClick={(file, e) => { + e.preventDefault() + e.stopPropagation() + console.log('picked a result', file) + this.handlePick(file) + }} + /> + </div> </div> ) |
