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/pix2pix | |
| parent | 3fbc955e814eb26e55fb083e688b49545b125f5e (diff) | |
navigationnnn
Diffstat (limited to 'app/client/modules/pix2pix')
| -rw-r--r-- | app/client/modules/pix2pix/index.js | 31 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/pix2pix.tasks.js | 1 |
2 files changed, 22 insertions, 10 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, |
