diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js index 451b69213..909659e87 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -3,8 +3,6 @@ import '../../styles/report/ReportPage.scss'; import React from 'react'; import {Route} from 'react-router-dom'; import {Col, Nav, NavItem} from 'react-bootstrap'; -import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph'; -import {edgeGroupToColor, options} from 'components/map/MapOptions'; import AuthComponent from '../AuthComponent'; import MustRunMonkeyWarning from '../report-components/common/MustRunMonkeyWarning'; import AttackReport from '../report-components/AttackReport' diff --git a/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js b/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js index c175becd3..3199385ba 100644 --- a/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js +++ b/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js @@ -3,10 +3,18 @@ import Graph from 'react-graph-vis'; import Dimensions from 'react-dimensions' class GraphWrapper extends React.Component { + + constructor(props) { + super(props); + } + render() { - let newOptions = this.props.options; - newOptions.height = this.props.containerHeight.toString() + 'px'; - newOptions.width = this.props.containerWidth.toString() + 'px'; + let newOptions = null; + if(this.props.options !== undefined){ + newOptions = this.props.options; + newOptions.height = this.props.containerHeight.toString() + 'px'; + newOptions.width = this.props.containerWidth.toString() + 'px'; + } return () } } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js index b44f367e1..63bde5203 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js @@ -3,7 +3,7 @@ import BreachedServers from 'components/report-components/security/BreachedServe import ScannedServers from 'components/report-components/security/ScannedServers'; import PostBreach from 'components/report-components/security/PostBreach'; import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph'; -import {edgeGroupToColor, options} from 'components/map/MapOptions'; +import {edgeGroupToColor, getOptions} from 'components/map/MapOptions'; import StolenPasswords from 'components/report-components/security/StolenPasswords'; import CollapsibleWellComponent from 'components/report-components/security/CollapsibleWell'; import {Line} from 'rc-progress'; @@ -54,14 +54,24 @@ class ReportPageComponent extends AuthComponent { super(props); this.state = { report: props.report, - graph: {nodes: [], edges: []} + graph: {nodes: [], edges: []}, + nodeStateList: [] }; } componentDidMount() { + this.getNodeStateListFromServer(); this.updateMapFromServer(); } + getNodeStateListFromServer = () => { + this.authFetch('/api/netmap/nodeStates') + .then(res => res.json()) + .then(res => { + this.setState({nodeStateList: res.node_states}); + }); + }; + componentWillUnmount() { clearInterval(this.interval); } @@ -396,7 +406,7 @@ class ReportPageComponent extends AuthComponent { Island Communication
- +