diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index 847c5c338..eff78794b 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -580,16 +580,17 @@ export function receiveControlNodeRemoved(nodeId) { }; } -export function receiveControlPipeFromParams(pipeId, rawTty) { +export function receiveControlPipeFromParams(pipeId, rawTty, resizeTtyControl) { // TODO add nodeId return { type: ActionTypes.RECEIVE_CONTROL_PIPE, pipeId, - rawTty + rawTty, + resizeTtyControl }; } -export function receiveControlPipe(pipeId, nodeId, rawTty) { +export function receiveControlPipe(pipeId, nodeId, rawTty, resizeTtyControl) { return (dispatch, getState) => { const state = getState(); if (state.get('nodeDetails').last() @@ -608,7 +609,8 @@ export function receiveControlPipe(pipeId, nodeId, rawTty) { type: ActionTypes.RECEIVE_CONTROL_PIPE, nodeId, pipeId, - rawTty + rawTty, + resizeTtyControl }); updateRoute(getState); diff --git a/client/app/scripts/components/embedded-terminal.js b/client/app/scripts/components/embedded-terminal.js index 6726cbd6e..149d5998e 100644 --- a/client/app/scripts/components/embedded-terminal.js +++ b/client/app/scripts/components/embedded-terminal.js @@ -38,7 +38,6 @@ class EmeddedTerminal extends React.Component { const nodeId = pipe.get('nodeId'); const node = details.get(nodeId); const d = node && node.details; - const control = d && d.controls && d.controls[0]; const titleBarColor = d && getNodeColorDark(d.rank, d.label, d.pseudo); const statusBarColor = d && brightenColor(titleBarColor); const title = d && d.label; @@ -54,7 +53,6 @@ class EmeddedTerminal extends React.Component { this.setState({cols, rows})); } diff --git a/client/app/scripts/reducers/root.js b/client/app/scripts/reducers/root.js index 3cb427f92..09d6de922 100644 --- a/client/app/scripts/reducers/root.js +++ b/client/app/scripts/reducers/root.js @@ -466,7 +466,8 @@ export function rootReducer(state = initialState, action) { return state.setIn(['controlPipes', action.pipeId], makeOrderedMap({ id: action.pipeId, nodeId: action.nodeId, - raw: action.rawTty + raw: action.rawTty, + resizeTtyControl: action.resizeTtyControl, })); } diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index 70f6fed6c..99e254b84 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -232,7 +232,11 @@ export function doControlRequest(nodeId, control, dispatch) { if (res) { if (res.pipe) { dispatch(blurSearch()); - dispatch(receiveControlPipe(res.pipe, nodeId, res.raw_tty, true)); + dispatch(receiveControlPipe( + res.pipe, + nodeId, + res.raw_tty, + {id: res.resize_tty_control, probeId: control.probeId, nodeId: control.nodeId})); } if (res.removedNode) { dispatch(receiveControlNodeRemoved(nodeId)); @@ -251,7 +255,7 @@ export function doControlRequest(nodeId, control, dispatch) { export function doResizePipe(pipeId, control, cols, rows) { const url = `api/control/${encodeURIComponent(control.probeId)}/` - + `${encodeURIComponent(control.nodeId)}/docker_resize_exec_tty`; + + `${encodeURIComponent(control.nodeId)}/${control.id}`; return reqwest({ method: 'POST',