diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-07 02:00:29 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-07 02:00:29 +0200 |
| commit | 798a9f835899103d79397a9461ff933d4000634c (patch) | |
| tree | 5705cdf30cdef83846bf36878b8201e98c282bb8 /app/client/modules/pix2pix | |
| parent | f7d19d22c70b9f8bc879243729eda76f6d66c805 (diff) | |
ughhh
Diffstat (limited to 'app/client/modules/pix2pix')
| -rw-r--r-- | app/client/modules/pix2pix/views/pix2pix.live.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/app/client/modules/pix2pix/views/pix2pix.live.js b/app/client/modules/pix2pix/views/pix2pix.live.js index 7651dcc..6f5b1bd 100644 --- a/app/client/modules/pix2pix/views/pix2pix.live.js +++ b/app/client/modules/pix2pix/views/pix2pix.live.js @@ -2,23 +2,27 @@ import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' -import Player from '../../../common/player.component' -import ParamGroup from '../../../common/paramGroup.component' -import Slider from '../../../common/slider.component' -import Select from '../../../common/select.component' -import Button from '../../../common/button.component' +import { + ParamGroup, Player, + Slider, Select, Button, Loading +} from '../../../common/' import { startRecording, stopRecording, saveFrame } from '../../../live/player' import * as liveActions from '../../../live/live.actions' import * as pix2pixTasks from '../pix2pix.tasks' +import * as pix2pixActions from '../pix2pix.actions' class Pix2PixLive extends Component { constructor(props){ super() + + if (! props.pix2pix || ! props.pix2pix.data) { + props.pix2pixActions.load_directories() + } props.actions.get_params() - props.actions.list_checkpoints() - props.actions.list_sequences() + // props.actions.list_checkpoints() + // props.actions.list_sequences() this.changeCheckpoint = this.changeCheckpoint.bind(this) this.changeEpoch = this.changeEpoch.bind(this) this.changeSequence = this.changeSequence.bind(this) @@ -67,6 +71,10 @@ class Pix2PixLive extends Component { } } render(){ + console.log(this.props) + if (this.props.pix2pix.loading) { + return <Loading /> + } return ( <div className='app centered'> <Player width={424} height={256} /> @@ -85,13 +93,13 @@ class Pix2PixLive extends Component { <Select name='sequence_name' title='sequence' - options={this.props.sequences} + options={this.props.pix2pix.data.sequences} onChange={this.changeSequence} /> <Select name='checkpoint_name' title='checkpoint' - options={this.props.checkpoints} + options={this.props.pix2pix.data.checkpoints} onChange={this.changeCheckpoint} /> <Select @@ -279,10 +287,12 @@ const mapStateToProps = state => ({ epochs: state.live.epochs, sequences: state.live.sequences, runner: state.system.runner, + pix2pix: state.module.pix2pix, }) const mapDispatchToProps = (dispatch, ownProps) => ({ - actions: bindActionCreators(liveActions, dispatch) + actions: bindActionCreators(liveActions, dispatch), + pix2pixActions: bindActionCreators(pix2pixActions, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(Pix2PixLive) |
