summaryrefslogtreecommitdiff
path: root/app/client/system/system.actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-02 16:05:13 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-02 16:05:13 +0200
commitdbd27d8ab455c6372fae1516dcb677a53d9e23ca (patch)
treea05a9d256a25411fc396d3dc94e5b993755ac119 /app/client/system/system.actions.js
parent814ea9116fe99194feec49f7dd4f7c2d82343f67 (diff)
fix runner client
Diffstat (limited to 'app/client/system/system.actions.js')
-rw-r--r--app/client/system/system.actions.js22
1 files changed, 17 insertions, 5 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
+}