summaryrefslogtreecommitdiff
path: root/app/client/live
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 17:58:04 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 17:58:04 +0200
commit4bc41e2c2a8b3fc8b22226a7f3ec6cc1e1a275b6 (patch)
tree5852f240d7d84afd5e8676029df238ba08b93c89 /app/client/live
parent34573a4f34c862ee884d0a3fd5badb1d4af1d9c2 (diff)
more dropdowns
Diffstat (limited to 'app/client/live')
-rw-r--r--app/client/live/actions.js5
-rw-r--r--app/client/live/index.js26
-rw-r--r--app/client/live/reducer.js7
3 files changed, 37 insertions, 1 deletions
diff --git a/app/client/live/actions.js b/app/client/live/actions.js
index 5ee030a..026788d 100644
--- a/app/client/live/actions.js
+++ b/app/client/live/actions.js
@@ -16,6 +16,11 @@ export const list_checkpoints = () => {
return { type: 'LOADING_CHECKPOINTS', }
}
+export const list_epochs = (path) => {
+ socket.list_epochs(path)
+ return { type: 'LOADING_EPOCHS', }
+}
+
export const list_sequences = () => {
socket.list_sequences()
return { type: 'LOADING_SEQUENCES', }
diff --git a/app/client/live/index.js b/app/client/live/index.js
index c438e4b..5699266 100644
--- a/app/client/live/index.js
+++ b/app/client/live/index.js
@@ -16,8 +16,13 @@ class App extends Component {
props.actions.list_checkpoints()
props.actions.list_sequences()
}
+ componentWillUpdate(nextProps) {
+ console.log('willupdate', nextProps.opt)
+ if (nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {
+ this.props.actions.list_epochs(nextProps.opt.checkpoint_name)
+ }
+ }
render(){
- const props = this.props
return (
<div className='app'>
<Player />
@@ -32,6 +37,21 @@ class App extends Component {
title='view mode'
options={['a','b','sequence','recursive']}
/>
+ <Select
+ name='checkpoint_name'
+ title='checkpoint'
+ options={this.props.checkpoints}
+ />
+ <Select
+ name='epoch'
+ title='epoch'
+ options={this.props.epochs}
+ />
+ <Select
+ name='sequence_name'
+ title='sequence'
+ options={this.props.sequences}
+ />
</ParamGroup>
</div>
<div className='column'>
@@ -146,6 +166,10 @@ class App extends Component {
}
const mapStateToProps = state => ({
+ opt: state.live.opt,
+ checkpoints: state.live.checkpoints,
+ epochs: state.live.epochs,
+ sequences: state.live.sequences,
})
const mapDispatchToProps = (dispatch, ownProps) => ({
diff --git a/app/client/live/reducer.js b/app/client/live/reducer.js
index c667689..e14a039 100644
--- a/app/client/live/reducer.js
+++ b/app/client/live/reducer.js
@@ -5,6 +5,7 @@ const liveInitialState = {
error: null,
opt: {},
checkpoints: [],
+ checkpoint_dir: ['latest'],
sequences: [],
}
@@ -38,6 +39,12 @@ const liveReducer = (state = liveInitialState, action) => {
checkpoints: action.checkpoints,
}
+ case 'LIST_CHECKPOINT_DIR':
+ return {
+ ...state,
+ checkpoint_dir: action.checkpoint_dir,
+ }
+
case 'LIST_SEQUENCES':
return {
...state,