From 7917bca6c4da52f65de7f5ff139d66db2ac9ec51 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 16 Jun 2018 16:02:33 +0200 Subject: navigationnnn --- app/client/modules/pix2pix/index.js | 31 +++++++++++++++++-------- app/client/modules/pix2pix/pix2pix.tasks.js | 1 + app/client/modules/pix2wav/index.js | 32 +++++++++++++++++-------- app/client/modules/samplernn/index.js | 36 +++++++++++++++++++---------- 4 files changed, 68 insertions(+), 32 deletions(-) (limited to 'app/client/modules') 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 ( -
- - - - -
- ) +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 ( +
+ + + + +
+ ) + } } 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 ( -
- - - - -
- ) +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 ( +
+ + + + +
+ ) + } } 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 ( -
- - - - - - -
- ) +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 ( +
+ + + + + + +
+ ) + } } function links(){ -- cgit v1.2.3-70-g09d2