diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 15:29:36 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 15:29:36 +0200 |
| commit | ceb342df85308e45729067d4b56aa5b2fbaabc49 (patch) | |
| tree | dad476e19c2a9513a93a999081e5f5013f18a921 /app | |
| parent | f694d542efa0cc5a819298f64b84d12e5af87527 (diff) | |
cmdz
Diffstat (limited to 'app')
| -rw-r--r-- | app/client/live/actions.js | 10 | ||||
| -rw-r--r-- | app/client/live/index.js | 2 | ||||
| -rw-r--r-- | app/client/live/reducer.js | 14 | ||||
| -rw-r--r-- | app/client/socket.js | 12 | ||||
| -rw-r--r-- | app/relay/index.js | 2 |
5 files changed, 21 insertions, 19 deletions
diff --git a/app/client/live/actions.js b/app/client/live/actions.js index bde954b..b604c67 100644 --- a/app/client/live/actions.js +++ b/app/client/live/actions.js @@ -11,6 +11,12 @@ export const set_param = (key, value) => { return { type: 'SET_PARAM', key, value, } } -export const get_checkpoints = () => { - return { type: 'GET_CHECKPOINTS', } +export const list_checkpoints = () => { + socket.list_checkpoints() + return { type: 'LOADING_CHECKPOINTS', } +} + +export const list_datasets = () => { + socket.list_datasets() + return { type: 'LOADING_DATASETS', } } diff --git a/app/client/live/index.js b/app/client/live/index.js index 5b5e1d6..51190b2 100644 --- a/app/client/live/index.js +++ b/app/client/live/index.js @@ -13,6 +13,8 @@ class App extends Component { constructor(props){ super() props.actions.get_params() + props.actions.list_checkpoints() + props.actions.list_datasets() } render(){ const props = this.props diff --git a/app/client/live/reducer.js b/app/client/live/reducer.js index 3771ff0..4c5dba7 100644 --- a/app/client/live/reducer.js +++ b/app/client/live/reducer.js @@ -5,7 +5,7 @@ const liveInitialState = { error: null, opt: {}, checkpoints: [], - videos: [], + datasets: [], } const liveReducer = (state = liveInitialState, action) => { @@ -35,19 +35,13 @@ const liveReducer = (state = liveInitialState, action) => { case 'LIST_CHECKPOINTS': return { ...state, - checkpoints: { - ...state.opt, - [action.key]: action.value, - } + checkpoints: action.checkpoints, } - case 'LIST_VIDEOS': + case 'LIST_DATASETS': return { ...state, - videos: { - ...state.opt, - [action.key]: action.value, - } + datasets: action.datasets, } default: diff --git a/app/client/socket.js b/app/client/socket.js index 70d71b8..cda7058 100644 --- a/app/client/socket.js +++ b/app/client/socket.js @@ -24,13 +24,13 @@ socket.on('res', (data) => { case 'list_checkpoints': store.dispatch({ type: 'LIST_CHECKPOINTS', - opt: data.res, + checkpoints: data.res, }) break - case 'list_videos': + case 'list_datasets': store.dispatch({ - type: 'LIST_VIDEOS', - opt: data.res, + type: 'LIST_DATASETS', + datasets: data.res, }) break default: @@ -66,9 +66,9 @@ export function list_checkpoints() { cmd: 'list_checkpoints', }) } -export function list_videos() { +export function list_datasets() { socket.emit('cmd', { - cmd: 'list_videos', + cmd: 'list_datasets', }) } export function get_params() { diff --git a/app/relay/index.js b/app/relay/index.js index ebe6370..9c0e071 100644 --- a/app/relay/index.js +++ b/app/relay/index.js @@ -31,7 +31,7 @@ remote.on('cmd', (data) => { break default: rpc.invoke('send_command', data.cmd, data.payload || null, (err, res, more) => { - console.log('got params', res) + console.log('sent command', res) remote.emit('res', { cmd: data.cmd, res: res, |
