diff options
Diffstat (limited to 'app/client/system')
| -rw-r--r-- | app/client/system/system.actions.js | 22 | ||||
| -rw-r--r-- | app/client/system/system.component.js | 12 |
2 files changed, 23 insertions, 11 deletions
diff --git a/app/client/system/system.actions.js b/app/client/system/system.actions.js index a318d68..2e5f783 100644 --- a/app/client/system/system.actions.js +++ b/app/client/system/system.actions.js @@ -1,16 +1,28 @@ import socket from '../socket' import types from '../types' -export const run = (cmd) => { +export const run = (cmd) => (dispatch) => { + dispatch({ type: types.system.running_command, cmd }) socket.system.run_system_command(cmd) - return { type: types.system.running_command, cmd } + .then(data => { + dispatch({ + type: types.system.command_output, + data: data, + }) + }) } -export const listDirectory = (opt) => { +export const listDirectory = (opt) => (dispatch) => { + dispatch({ type: types.system.listing_directory, opt }) socket.system.list_directory(opt) - return { type: types.system.listing_directory, opt } + .then(data => { + dispatch({ + type: types.system.list_directory, + data: data, + }) + }) } export const changeTool = (tool) => { return { type: types.app.change_tool, tool } -}
\ No newline at end of file +} diff --git a/app/client/system/system.component.js b/app/client/system/system.component.js index a4be0c9..d0e6d48 100644 --- a/app/client/system/system.component.js +++ b/app/client/system/system.component.js @@ -78,16 +78,16 @@ class System extends Component { </Group> <Group title="Test"> <Param title='CPU Test Task'> - <button onClick={() => actions.task.start_task(cpu_test_task, { preempt: true, watch: true })}>Start</button> - <button onClick={() => actions.task.stop_task(runner.cpu.task)}>Stop</button> + <button onClick={() => actions.queue.start_task(cpu_test_task, { preempt: true, watch: true })}>Start</button> + <button onClick={() => actions.queue.stop_task(runner.cpu.task)}>Stop</button> </Param> <Param title='GPU Test Task'> - <button onClick={() => actions.task.start_task(gpu_test_task, { preempt: true, watch: true })}>Start</button> - <button onClick={() => actions.task.stop_task(runner.gpu.task)}>Stop</button> + <button onClick={() => actions.queue.start_task(gpu_test_task, { preempt: true, watch: true })}>Start</button> + <button onClick={() => actions.queue.stop_task(runner.gpu.task)}>Stop</button> </Param> <Param title='Live Test Task'> - <button onClick={() => actions.task.start_task(live_test_task, { preempt: true, watch: true })}>Start</button> - <button onClick={() => actions.task.stop_task(runner.cpu.task)}>Stop</button> + <button onClick={() => actions.queue.start_task(live_test_task, { preempt: true, watch: true })}>Start</button> + <button onClick={() => actions.queue.stop_task(runner.cpu.task)}>Stop</button> </Param> <Param title='Test Live RPC'> <button onClick={() => actions.live.get_params()}>Get</button> |
