Files
weave-scope/client/app/scripts/components/embedded-terminal.js
Simon Howe 0785d5393a Fixes pipes again
- 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).
2016-01-19 16:48:35 +01:00

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>
);
}