mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 11:11:13 +00:00
- 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.
22 lines
782 B
JavaScript
22 lines
782 B
JavaScript
import React from 'react';
|
|
|
|
import { getNodeColor, getNodeColorDark } from '../utils/color-utils';
|
|
import Terminal from './terminal';
|
|
|
|
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} />
|
|
</div>
|
|
);
|
|
}
|