summaryrefslogtreecommitdiff
path: root/app/client/system/system.reducer.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-27 03:36:38 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-27 03:36:38 +0200
commit10eab813d70a203e5b81583eac165e33a1bf6f6d (patch)
tree3840a1fc534129b5b7b439fd7899cc8c8ae0e016 /app/client/system/system.reducer.js
parente4957554e777bd9e25097fcb4db40686848a908c (diff)
auto scroll to bottom
Diffstat (limited to 'app/client/system/system.reducer.js')
-rw-r--r--app/client/system/system.reducer.js30
1 files changed, 27 insertions, 3 deletions
diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js
index a7ae8d1..c29572e 100644
--- a/app/client/system/system.reducer.js
+++ b/app/client/system/system.reducer.js
@@ -22,8 +22,6 @@ const systemInitialState = {
rpc: {
connected: false,
status: "unknown",
- cpu_cmd: "unknown",
- gpu_cmd: "unknown",
error: null,
},
cmd: {
@@ -34,6 +32,10 @@ const systemInitialState = {
stdout: "",
stderr: "",
},
+ runner: {
+ cpu: { status: 'IDLE', task: {} },
+ gpu: { status: 'IDLE', task: {} },
+ },
stdout: "",
stderr: "",
}
@@ -109,7 +111,8 @@ const systemReducer = (state = systemInitialState, action) => {
status: 'connected',
connected: true,
error: null,
- }
+ },
+ runner: action.runner,
}
case types.system.rpc_connected:
return {
@@ -147,9 +150,30 @@ const systemReducer = (state = systemInitialState, action) => {
case types.task.task_begin:
return {
...state,
+ runner: {
+ ...state.runner,
+ [action.task.processor]: { status: 'RUNNING', task: action.task },
+ },
+ cmd: {
+ ...state.cmd,
+ loaded: false,
+ stdout: "",
+ stderr: "",
+ },
stdout: "",
stderr: "",
}
+ case types.task.task_finish:
+ if (state.runner[action.task.processor].task.uuid !== action.task.uuid) {
+ return state
+ }
+ return {
+ ...state,
+ runner: {
+ ...state.runner,
+ [action.task.processor]: { status: 'IDLE', task: {} },
+ },
+ }
case types.system.stdout:
return {
...state,