diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-27 04:16:43 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-27 04:16:43 +0200 |
| commit | 9e08754fa2b4fde9b060606fe5851f31590690d6 (patch) | |
| tree | 0c13cb827b11f3a849676b84c6958ae0a7b1c1c9 /app/client/system/system.component.js | |
| parent | f82ca77348bb8e025240bab1003ae697e27617e2 (diff) | |
test sending events
Diffstat (limited to 'app/client/system/system.component.js')
| -rw-r--r-- | app/client/system/system.component.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/client/system/system.component.js b/app/client/system/system.component.js index 8c8767f..a663acf 100644 --- a/app/client/system/system.component.js +++ b/app/client/system/system.component.js @@ -6,6 +6,7 @@ import Group from '../common/group.component' import Param from '../common/param.component' import * as systemActions from './system.actions' +import * as liveActions from '../live/live.actions' import * as taskActions from '../task/task.actions' const cpu_test_task = { @@ -29,6 +30,8 @@ const live_test_task = { epochs: 1, opt: {} } +const fruits = ["apple","pear","banana","strawberry"] +function choice(a){ return a[Math.floor(Math.random()*a.length)]} class System extends Component { constructor(props){ @@ -86,6 +89,10 @@ class System extends Component { <button onClick={() => actions.task.start_task(live_test_task, { preempt: true, watch: true })}>Start</button> <button onClick={() => actions.task.stop_task(live_test_task)}>Stop</button> </Param> + <Param title='Test Live RPC'> + <button onClick={() => actions.live.get_params()}>Get</button> + <button onClick={() => actions.live.set_param('fruit', choice(fruits))}>Set</button> + </Param> </Group> </div> {this.renderCommandOutput()} @@ -135,13 +142,15 @@ class System extends Component { } } const mapStateToProps = state => ({ - ...state.system + ...state.system, + ...state.live, }) const mapDispatchToProps = (dispatch, ownProps) => ({ actions: { system: bindActionCreators(systemActions, dispatch), task: bindActionCreators(taskActions, dispatch), + live: bindActionCreators(liveActions, dispatch), }, }) |
