forked from p15670423/monkey
Add tooltips to preview pane
This commit is contained in:
parent
246c653029
commit
d95515d678
|
@ -1,9 +1,18 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Icon} from 'react-fa';
|
import {Icon} from 'react-fa';
|
||||||
import Toggle from 'react-toggle';
|
import Toggle from 'react-toggle';
|
||||||
|
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
|
||||||
|
|
||||||
class PreviewPaneComponent extends React.Component {
|
class PreviewPaneComponent extends React.Component {
|
||||||
|
|
||||||
|
generateToolTip(text) {
|
||||||
|
return (
|
||||||
|
<OverlayTrigger placement="top" overlay={<Tooltip id="tooltip">{text}</Tooltip>}>
|
||||||
|
<a><i className="glyphicon glyphicon-info-sign"/></a>
|
||||||
|
</OverlayTrigger>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
osRow(asset) {
|
osRow(asset) {
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -34,7 +43,10 @@ class PreviewPaneComponent extends React.Component {
|
||||||
accessibleRow(asset) {
|
accessibleRow(asset) {
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
<th>Accessible From</th>
|
<th>
|
||||||
|
Accessible From
|
||||||
|
{this.generateToolTip('List of machine which can access this one using a network protocol')}
|
||||||
|
</th>
|
||||||
<td>{asset.accessible_from_nodes.map(val => <div key={val}>{val}</div>)}</td>
|
<td>{asset.accessible_from_nodes.map(val => <div key={val}>{val}</div>)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
@ -63,10 +75,14 @@ class PreviewPaneComponent extends React.Component {
|
||||||
forceKillRow(asset) {
|
forceKillRow(asset) {
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
<th>Force Kill</th>
|
<th>
|
||||||
|
Force Kill
|
||||||
|
{this.generateToolTip('If this is on, monkey will die next time it communicates')}
|
||||||
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<Toggle id={asset.id} checked={!asset.config.alive} icons={false} disabled={asset.dead}
|
<Toggle id={asset.id} checked={!asset.config.alive} icons={false} disabled={asset.dead}
|
||||||
onChange={(e) => this.forceKill(e, asset)} />
|
onChange={(e) => this.forceKill(e, asset)} />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
@ -79,7 +95,10 @@ class PreviewPaneComponent extends React.Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h4 style={{'marginTop': '2em'}}>Timeline</h4>
|
<h4 style={{'marginTop': '2em'}}>
|
||||||
|
Exploit Timeline
|
||||||
|
{this.generateToolTip('Timeline of exploit attempts. Red is successful. Gray is unsuccessful')}
|
||||||
|
</h4>
|
||||||
<ul className="timeline">
|
<ul className="timeline">
|
||||||
{ asset.exploits.map(exploit =>
|
{ asset.exploits.map(exploit =>
|
||||||
<li key={exploit.timestamp}>
|
<li key={exploit.timestamp}>
|
||||||
|
|
Loading…
Reference in New Issue