diff options
Diffstat (limited to 'app/client/system/system.reducer.js')
| -rw-r--r-- | app/client/system/system.reducer.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index bc19fd1..e581813 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -1,3 +1,4 @@ +import types from '../types' import moment from 'moment' let FileSaver = require('file-saver') @@ -8,6 +9,15 @@ const systemInitialState = { site: { name: 'Lens Cortex', }, + cmd: { + loading: false, + loaded: false, + name: null, + error: null, + stdout: null, + stderr: null, + }, + currentTask: { id: 1072, activity: 'train', @@ -29,6 +39,9 @@ const systemInitialState = { { url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2150.png', }, + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2146%20(1).png', + }, ], tasks: [ { @@ -98,6 +111,30 @@ const systemInitialState = { const systemReducer = (state = systemInitialState, action) => { switch(action.type) { + case types.system.running_command: + return { + ...state, + cmd: { + loading: true, + loaded: false, + name: action.cmd, + error: null, + stdout: null, + stderr: null, + } + } + case types.system.command_output: + return { + ...state, + cmd: { + loading: false, + loaded: true, + name: action.data.cmd, + error: action.data.error, + stdout: action.data.stdout, + stderr: action.data.stderr, + } + } default: return state } |
