mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-24 07:46:41 +00:00
- Treat control objects that come back from the server as little black boxes. - Pass our local client nodeId around more instead, use that for comparisons etc, (vs. inspecting the control object and doing brittle magic w/ the ids).
21 lines
801 B
JavaScript
21 lines
801 B
JavaScript
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');
|
|
|
|
// 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>
|
|
);
|
|
}
|