diff options
Diffstat (limited to 'app/client/system')
| -rw-r--r-- | app/client/system/system.component.js | 9 | ||||
| -rw-r--r-- | app/client/system/system.reducer.js | 16 |
2 files changed, 22 insertions, 3 deletions
diff --git a/app/client/system/system.component.js b/app/client/system/system.component.js index f8cf139..07428e5 100644 --- a/app/client/system/system.component.js +++ b/app/client/system/system.component.js @@ -90,7 +90,7 @@ class System extends Component { ) } renderCommandOutput(){ - const { cmd } = this.props + const { cmd, stdout, stderr } = this.props let output if (cmd.loading) { output = 'Loading: ' + cmd.name @@ -106,6 +106,13 @@ class System extends Component { } } } + else { + output = stdout + if (cmd.stderr) { + output += '\n\n_________________________________\n\n' + output += stderr + } + } return ( <div> <div className='screen'>{output}</div> diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index ac7b20e..2a58cd7 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -31,9 +31,11 @@ const systemInitialState = { loaded: false, name: null, error: null, - stdout: null, - stderr: null, + stdout: "", + stderr: "", }, + stdout: "", + stderr: "", } const systemReducer = (state = systemInitialState, action) => { @@ -142,6 +144,16 @@ const systemReducer = (state = systemInitialState, action) => { stderr: action.data.stderr, } } + case types.system.stdout: + return { + ...state, + stdout: state.stdout + action.data, + } + case types.system.stderr: + return { + ...state, + stderr: state.stderr + action.data, + } default: return state } |
