mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Fixes exec/attach from the 2nd+ card.
- Also fixes strange issue where hitting ESC while a terminal was active, would update the route, reload the top card, and break the terminal connection status.
This commit is contained in:
@@ -87,7 +87,7 @@ export default class App extends React.Component {
|
||||
{showingTerminal && <EmbeddedTerminal
|
||||
pipe={this.state.controlPipe}
|
||||
nodeId={this.state.controlPipe.nodeId}
|
||||
nodes={this.state.nodes} />}
|
||||
details={this.state.nodeDetails} />}
|
||||
|
||||
<div className="header">
|
||||
<Logo />
|
||||
|
||||
@@ -3,18 +3,19 @@ import React from 'react';
|
||||
import { getNodeColor, getNodeColorDark } from '../utils/color-utils';
|
||||
import Terminal from './terminal';
|
||||
|
||||
export default function EmeddedTerminal({pipe, nodeId, nodes}) {
|
||||
const node = nodes.get(nodeId);
|
||||
const titleBarColor = node && getNodeColorDark(node.get('rank'), node.get('label_major'));
|
||||
const statusBarColor = node && getNodeColor(node.get('rank'), node.get('label_major'));
|
||||
const title = node && node.get('label_major');
|
||||
export default function EmeddedTerminal({pipe, nodeId, details}) {
|
||||
const node = details.get(nodeId);
|
||||
const d = node && node.details;
|
||||
const titleBarColor = d && getNodeColorDark(d.rank, d.label_major);
|
||||
const statusBarColor = d && getNodeColor(d.rank, d.label_major);
|
||||
const title = d && d.label_major;
|
||||
|
||||
// React unmount/remounts when key changes, this is important for cleaning up
|
||||
// the term.js and creating a new one for the new pipe.
|
||||
return (
|
||||
<div className="terminal-embedded">
|
||||
<Terminal key={pipe.id} pipe={pipe} titleBarColor={titleBarColor}
|
||||
statusBarColor={statusBarColor} title={title} />
|
||||
statusBarColor={statusBarColor} title={title} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user