diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-29 04:22:53 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-29 04:22:53 +0200 |
| commit | b096af3c698bdefe80016088d2764e03649de9a6 (patch) | |
| tree | f454b4fa73bda6478ae7049601b24e9a2b2b074f /app | |
| parent | 0cabfdeaa17ff1db1fce7745523cfa2defadf364 (diff) | |
train link....!
Diffstat (limited to 'app')
| -rw-r--r-- | app/client/common/fileList.component.js | 2 | ||||
| -rw-r--r-- | app/client/modules/samplernn/datasets.component.js | 34 | ||||
| -rw-r--r-- | app/server/site.js | 2 |
3 files changed, 31 insertions, 7 deletions
diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index 8ee61f7..c12a461 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -19,8 +19,6 @@ class FileList extends Component { {file.epoch && <div className="epoch">epoch {file.epoch}</div>} <div className='activity'>{file.activity || ''} {file.module || ''}</div> {this.props.options && this.props.options(file)} - {file.epochs && <div className='epochs'>{file.epochs} ep.</div>} - {file.eta && <div className='eta'>{file.eta}</div>} </div> ) }) diff --git a/app/client/modules/samplernn/datasets.component.js b/app/client/modules/samplernn/datasets.component.js index 86ecc21..efbf992 100644 --- a/app/client/modules/samplernn/datasets.component.js +++ b/app/client/modules/samplernn/datasets.component.js @@ -3,6 +3,8 @@ import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { actions } from '../../api' +import * as taskActions from '../../task/task.actions' +import * as systemActions from '../../system/system.actions' // folderActions.index({ module: 'samplernn' }) // folderActions.show(12) // folderActions.create({ module: 'samplernn', name: 'foo' }) @@ -25,6 +27,7 @@ class SampleRNNDatasets extends Component { this.handleName = this.handleName.bind(this) this.handleUpload = this.handleUpload.bind(this) this.handleURL = this.handleURL.bind(this) + this.fetchURL = this.fetchURL.bind(this) this.fileOptions = this.fileOptions.bind(this) props.actions.folder.index({ module: 'samplernn' }) props.actions.file.index({ module: 'samplernn' }) @@ -78,12 +81,30 @@ class SampleRNNDatasets extends Component { url }) } + fetchURL(url) { + actions.task.start_task({ + activity: 'cpu', + module: 'samplernn', + epochs: 1, + opt: { url } + }, { preempt: true, watch: true }) + } fileOptions(file){ console.log(file) if (file.activity === 'url' && !file.dataset) { - return ( - <div className='gray'>fetching...</div> - ) + if (this.props.runner.cpu.status !== 'IDLE') { + return ( + <div className='gray'> + fetching... + </div> + ) + } else { + return ( + <div className='link' onClick={this.fetchURL}> + fetch + </div> + ) + } } return ( <div> @@ -138,14 +159,17 @@ class SampleRNNDatasets extends Component { } const mapStateToProps = state => ({ - samplernn: state.module.samplernn + samplernn: state.module.samplernn, + runner: state.system.runner, + task: state.task, }) const mapDispatchToProps = (dispatch, ownProps) => ({ actions: { folder: bindActionCreators(actions.folder, dispatch), file: bindActionCreators(actions.file, dispatch), - task: bindActionCreators(actions.task, dispatch), + task: bindActionCreators(taskActions, dispatch), + system: bindActionCreators(systemActions, dispatch), } }) diff --git a/app/server/site.js b/app/server/site.js index 913ae69..f2c6b93 100644 --- a/app/server/site.js +++ b/app/server/site.js @@ -90,6 +90,8 @@ app.post('/folders/:id/upload/', function serve_index(req, res) { res.sendFile(path.join(__dirname, '../../public', 'index.html')) } app.get('/:module/:mode/', serve_index) +app.get('/system/', serve_index) +app.get('/dashboard/', serve_index) app.get('/', serve_index) server.listen(process.env.EXPRESS_PORT, () => { |
