diff options
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.actions.js | 23 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/pix2pixhd.results.js | 2 | ||||
| -rw-r--r-- | app/client/socket/socket.actions.js | 3 | ||||
| -rw-r--r-- | app/client/types.js | 2 |
4 files changed, 28 insertions, 2 deletions
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.actions.js b/app/client/modules/pix2pixhd/pix2pixhd.actions.js index 1ee4886..1b22616 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.actions.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.actions.js @@ -135,3 +135,26 @@ export const load_directories = (id) => (dispatch) => { console.error(e) }) } + +export const load_results = (id) => (dispatch) => { + console.log('hi') + const module = pix2pixhdModule.name + util.allProgress([ + actions.file.index({ module, generated: true }), + actions.socket.list_sequences({ module, dir: 'results' }), + actions.socket.list_directory({ module, dir: 'renders' }), + ], (percent, i, n) => { + console.log('pix2pixhd load progress', i, n) + dispatch({ type: types.app.load_progress, progress: { i, n }}) + }).then(res => { + const [files, results, renders] = res //, datasets, results, output, datasetUsage, lossReport] = res + console.log(files, results, renders) + dispatch({ + type: types.pix2pixhd.load_results, + results: { + results, + renders, + } + }) + }) +}
\ No newline at end of file diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js index dcbbfad..cf0bdf7 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js @@ -13,7 +13,7 @@ import { FileList, FileRow } from '../../../common/fileList.component' class Pix2pixHDResults extends Component { constructor(props){ super() - // if (!props.pix2pixhd.data) props.actions.load_directories() + if (!props.pix2pixhd.results) props.actions.load_results() } render(){ if (this.props.pix2pixhd.loading) return <Loading progress={this.props.pix2pixhd.progress} /> diff --git a/app/client/socket/socket.actions.js b/app/client/socket/socket.actions.js index 38c1b7f..e15dda2 100644 --- a/app/client/socket/socket.actions.js +++ b/app/client/socket/socket.actions.js @@ -10,6 +10,9 @@ export function disk_usage(opt) { export function list_directory(opt) { return syscall_async('list_directory', opt).then(res => res.files) } +export function list_sequences(opt) { + return syscall_async('list_sequences', opt).then(res => res.sequences) +} export function run_script(opt) { return syscall_async('run_script', opt) } diff --git a/app/client/types.js b/app/client/types.js index 8021a0e..e710248 100644 --- a/app/client/types.js +++ b/app/client/types.js @@ -105,7 +105,7 @@ export default { 'init', 'set_folder' ]), pix2pixhd: with_type('pix2pixhd', [ - 'init', 'set_folder' + 'init', 'set_folder', 'load_results' ]), pix2wav: with_type('pix2wav', [ 'init', 'set_folder' |
