From b99047363607a09e25c567a54b185e1655f9f32d Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Mon, 9 Oct 2017 12:12:51 +0200 Subject: [PATCH] Use a context sensitive route for the popped out terminal.html - Service-ui has learned a new route which corresponds to the existing scope terminal.html route. Both standalone and service-ui scope can now respond to terminal.html: - If using standalone scope path/to/scope/ -> path/to/scope/terminal.html will be used. - If using service-ui app/instanceid -> app/instanceId/terminal.html --- client/app/scripts/components/terminal.js | 4 ++-- client/app/scripts/index.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/app/scripts/components/terminal.js b/client/app/scripts/components/terminal.js index 2f22e099d..380a9ddb5 100644 --- a/client/app/scripts/components/terminal.js +++ b/client/app/scripts/components/terminal.js @@ -9,7 +9,7 @@ import Term from 'xterm'; import { clickCloseTerminal } from '../actions/app-actions'; import { getNeutralColor } from '../utils/color-utils'; import { setDocumentTitle } from '../utils/title-utils'; -import { getPipeStatus, doResizeTty, getWebsocketUrl, getApiPath } from '../utils/web-api-utils'; +import { getPipeStatus, doResizeTty, getWebsocketUrl, basePath } from '../utils/web-api-utils'; const log = debug('scope:terminal'); @@ -243,7 +243,7 @@ class Terminal extends React.Component { const bcr = this.node.getBoundingClientRect(); const minWidth = (this.state.characterWidth * 80) + (8 * 2); - openNewWindow(`${getApiPath()}/terminal.html#!/state/${paramString}`, bcr, minWidth); + openNewWindow(`${basePath(window.location.pathname)}/terminal.html#!/state/${paramString}`, bcr, minWidth); } handleResize() { diff --git a/client/app/scripts/index.js b/client/app/scripts/index.js index 7f5362bfe..85cbfd120 100644 --- a/client/app/scripts/index.js +++ b/client/app/scripts/index.js @@ -1,3 +1,4 @@ exports.reducer = require('./reducers/root').default; exports.Scope = require('./components/app').default; exports.actions = require('./actions/app-actions'); +exports.TerminalApp = require('./components/terminal-app').default;