diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 16:02:33 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 16:02:33 +0200 |
| commit | 7917bca6c4da52f65de7f5ff139d66db2ac9ec51 (patch) | |
| tree | e6790843122e733aba70ccce356e066a0d25f397 /app/client/modules | |
| parent | 3fbc955e814eb26e55fb083e688b49545b125f5e (diff) | |
navigationnnn
Diffstat (limited to 'app/client/modules')
| -rw-r--r-- | app/client/modules/pix2pix/index.js | 31 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/pix2pix.tasks.js | 1 | ||||
| -rw-r--r-- | app/client/modules/pix2wav/index.js | 32 | ||||
| -rw-r--r-- | app/client/modules/samplernn/index.js | 36 |
4 files changed, 68 insertions, 32 deletions
diff --git a/app/client/modules/pix2pix/index.js b/app/client/modules/pix2pix/index.js index 174398d..21bffe7 100644 --- a/app/client/modules/pix2pix/index.js +++ b/app/client/modules/pix2pix/index.js @@ -1,22 +1,33 @@ import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' +import actions from '../../actions' + import util from '../../util' import Pix2PixNew from './views/pix2pix.new' import Pix2PixShow from './views/pix2pix.show' import Pix2PixLive from './views/pix2pix.live' -function router () { - document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' - return ( - <section> - <Route exact path='/pix2pix/new/' component={Pix2PixNew} /> - <Route exact path='/pix2pix/sequences/' component={Pix2PixShow} /> - <Route exact path='/pix2pix/sequences/:id/' component={Pix2PixShow} /> - <Route exact path='/pix2pix/live/' component={Pix2PixLive} /> - </section> - ) +class router { + componentWillMount(){ + actions.system.changeTool('pix2pix') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + componentWillReceiveProps(){ + actions.system.changeTool('pix2pix') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + render(){ + return ( + <section> + <Route exact path='/pix2pix/new/' component={Pix2PixNew} /> + <Route exact path='/pix2pix/sequences/' component={Pix2PixShow} /> + <Route exact path='/pix2pix/sequences/:id/' component={Pix2PixShow} /> + <Route exact path='/pix2pix/live/' component={Pix2PixLive} /> + </section> + ) + } } function links(){ diff --git a/app/client/modules/pix2pix/pix2pix.tasks.js b/app/client/modules/pix2pix/pix2pix.tasks.js index c4b79fb..f3a4fec 100644 --- a/app/client/modules/pix2pix/pix2pix.tasks.js +++ b/app/client/modules/pix2pix/pix2pix.tasks.js @@ -40,6 +40,7 @@ export const train_task = (dataset, folder_id, epochs=1) => dispatch => { module: 'pix2pix', activity: 'train', dataset: dataset.name, + epoch: 0, epochs: epochs, opt: { folder_id: folder_id, diff --git a/app/client/modules/pix2wav/index.js b/app/client/modules/pix2wav/index.js index 4bbae56..1bc953a 100644 --- a/app/client/modules/pix2wav/index.js +++ b/app/client/modules/pix2wav/index.js @@ -1,21 +1,33 @@ import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' + +import actions from '../../actions' + import util from '../../util' import Pix2WavNew from './views/pix2wav.new' import Pix2WavShow from './views/pix2wav.show' import Pix2WavLive from './views/pix2wav.live' -function router () { - document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' - return ( - <section> - <Route exact path='/pix2wav/new/' component={Pix2WavNew} /> - <Route exact path='/pix2wav/datasets/' component={Pix2WavShow} /> - <Route exact path='/pix2wav/datasets/:id/' component={Pix2WavShow} /> - <Route exact path='/pix2wav/live/' component={Pix2WavLive} /> - </section> - ) +class router { + componentWillMount(){ + actions.system.changeTool('pix2wav') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #bdf, #def)' + } + componentWillReceiveProps(){ + actions.system.changeTool('pix2wav') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #bdf, #def)' + } + render(){ + return ( + <section> + <Route exact path='/pix2wav/new/' component={Pix2WavNew} /> + <Route exact path='/pix2wav/datasets/' component={Pix2WavShow} /> + <Route exact path='/pix2wav/datasets/:id/' component={Pix2WavShow} /> + <Route exact path='/pix2wav/live/' component={Pix2WavLive} /> + </section> + ) + } } function links(){ diff --git a/app/client/modules/samplernn/index.js b/app/client/modules/samplernn/index.js index 2a9d64d..85c99e4 100644 --- a/app/client/modules/samplernn/index.js +++ b/app/client/modules/samplernn/index.js @@ -1,5 +1,8 @@ import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' + +import actions from '../../actions' + import util from '../../util' import SampleRNNNew from './views/samplernn.new' @@ -8,18 +11,27 @@ import SampleRNNImport from './views/samplernn.import' import SampleRNNResults from './views/samplernn.results' import SampleRNNGraph from './views/samplernn.graph' -function router () { - document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' - return ( - <section> - <Route exact path='/samplernn/new' component={SampleRNNNew} /> - <Route exact path='/samplernn/datasets' component={SampleRNNShow} /> - <Route exact path='/samplernn/datasets/:id' component={SampleRNNShow} /> - <Route exact path='/samplernn/import' component={SampleRNNImport} /> - <Route exact path='/samplernn/results' component={SampleRNNResults} /> - <Route exact path='/samplernn/graph' component={SampleRNNGraph} /> - </section> - ) +class router { + componentWillMount(){ + actions.system.changeTool('samplernn') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' + } + componentWillReceiveProps(){ + actions.system.changeTool('samplernn') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' + } + render(){ + return ( + <section> + <Route exact path='/samplernn/new' component={SampleRNNNew} /> + <Route exact path='/samplernn/datasets' component={SampleRNNShow} /> + <Route exact path='/samplernn/datasets/:id' component={SampleRNNShow} /> + <Route exact path='/samplernn/import' component={SampleRNNImport} /> + <Route exact path='/samplernn/results' component={SampleRNNResults} /> + <Route exact path='/samplernn/graph' component={SampleRNNGraph} /> + </section> + ) + } } function links(){ |
