diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index d248c33873..672452ba32 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -366,7 +366,8 @@ export function doControl(nodeId, control) { return (dispatch) => { dispatch({ type: ActionTypes.DO_CONTROL, - nodeId + nodeId, + control }); doControlRequest(nodeId, control, dispatch); }; diff --git a/client/app/scripts/components/terminal.js b/client/app/scripts/components/terminal.js index af2ce51da2..599237deea 100644 --- a/client/app/scripts/components/terminal.js +++ b/client/app/scripts/components/terminal.js @@ -316,6 +316,7 @@ class Terminal extends React.Component { + {this.getControlStatusIcon()} {this.getTitle()} ); @@ -382,12 +383,28 @@ class Terminal extends React.Component { ); } + getControlStatusIcon() { + const icon = this.props.controlStatus && this.props.controlStatus.get('raw') + ? 'terminal' + : 'desktop'; + return ( + + ); + } } +function mapStateToProps(state, ownProps) { + const controlStatus = state.get('controlPipes').find((pipe) => + pipe.get('nodeId') === ownProps.pipe.get('nodeId') + ); + return { controlStatus }; +} Terminal.defaultProps = { connect: true }; - -export default connect()(Terminal); +export default connect(mapStateToProps)(Terminal);