diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-05 19:18:56 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-05 19:18:56 +0200 |
| commit | 9f81aab18011637ac8daf4cdcf7223ee636a4663 (patch) | |
| tree | f38bf3f711f9838909ff1b5a8f1a8fe1ef922734 /app/client/modules/pix2pix | |
| parent | f827f34c60d8660abfe22faf091b79e8220eb0fa (diff) | |
boilerplate for p2p/p2w
Diffstat (limited to 'app/client/modules/pix2pix')
| -rw-r--r-- | app/client/modules/pix2pix/index.js | 9 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/live.component.js | 4 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/pix2pix.module.js | 6 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/pix2pix.reducer.js | 42 |
4 files changed, 54 insertions, 7 deletions
diff --git a/app/client/modules/pix2pix/index.js b/app/client/modules/pix2pix/index.js index b9af2f4..87bbf0d 100644 --- a/app/client/modules/pix2pix/index.js +++ b/app/client/modules/pix2pix/index.js @@ -6,7 +6,7 @@ import Pix2PixLive from './live.component' function router () { return ( <section> - <Route path='/pix2pix/live/' component={Pix2PixLive} /> + <Route exact path='/pix2pix/live/' component={Pix2PixLive} /> </section> ) } @@ -14,9 +14,8 @@ function router () { function links(){ return ( <span> - <span>datasets</span> - <span>checkpoints</span> - <span>results</span> + <span><Link to="/pix2pix/datasets/">datasets</Link></span> + <span><Link to="/pix2pix/graph/">graph</Link></span> <span><Link to="/pix2pix/live/">live</Link></span> </span> ) @@ -25,4 +24,4 @@ function links(){ export default { name: 'pix2pix', router, links, -}
\ No newline at end of file +} diff --git a/app/client/modules/pix2pix/live.component.js b/app/client/modules/pix2pix/live.component.js index 82f315c..bb6c730 100644 --- a/app/client/modules/pix2pix/live.component.js +++ b/app/client/modules/pix2pix/live.component.js @@ -12,7 +12,7 @@ import { startRecording, stopRecording, saveFrame } from '../../live/player' import * as liveActions from '../../live/live.actions' -class LivePix2Pix extends Component { +class Pix2PixLive extends Component { constructor(props){ super() props.actions.get_params() @@ -250,4 +250,4 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ actions: bindActionCreators(liveActions, dispatch) }) -export default connect(mapStateToProps, mapDispatchToProps)(LivePix2Pix) +export default connect(mapStateToProps, mapDispatchToProps)(Pix2PixLive) diff --git a/app/client/modules/pix2pix/pix2pix.module.js b/app/client/modules/pix2pix/pix2pix.module.js new file mode 100644 index 0000000..63b1e94 --- /dev/null +++ b/app/client/modules/pix2pix/pix2pix.module.js @@ -0,0 +1,6 @@ +const pix2pixModule = { + name: 'pix2pix', + datatype: 'audio', +} + +export default pix2pixModule diff --git a/app/client/modules/pix2pix/pix2pix.reducer.js b/app/client/modules/pix2pix/pix2pix.reducer.js new file mode 100644 index 0000000..fbd38d1 --- /dev/null +++ b/app/client/modules/pix2pix/pix2pix.reducer.js @@ -0,0 +1,42 @@ +import types from '../../types' + +const pix2pixInitialState = { + loading: true, + error: null, + folders: [], + folder_id: 0, + data: null, + lossReport: null, +} + +const pix2pixReducer = (state = pix2pixInitialState, action) => { + // console.log(action.type) + switch(action.type) { + case types.pix2pix.init: + return { + ...state, + loading: false, + data: action.data, + } + + case types.socket.connect: + return { + ...state, + } + + case types.task.task_begin: + return { + ...state, + } + + case types.task.task_finish: + return { + ...state, + } + + default: + return state + } +} + +export default pix2pixReducer |
