diff --git a/monkey_island/cc/ui/package.json b/monkey_island/cc/ui/package.json index 8d63d00c2..e47f4bae0 100644 --- a/monkey_island/cc/ui/package.json +++ b/monkey_island/cc/ui/package.json @@ -70,6 +70,7 @@ "react-bootstrap": "^0.31.2", "react-copy-to-clipboard": "^5.0.0", "react-data-components": "^1.1.1", + "react-dimensions": "^1.3.0", "react-dom": "^15.6.1", "react-fa": "^4.2.0", "react-graph-vis": "^0.1.3", diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index a418cc05f..4fe280714 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -1,9 +1,9 @@ import React from 'react'; import {Col} from 'react-bootstrap'; -import Graph from 'react-graph-vis'; -import PreviewPane from 'components/preview-pane/PreviewPane'; import {Link} from 'react-router-dom'; import {Icon} from 'react-fa'; +import PreviewPane from 'components/preview-pane/PreviewPane'; +import {ReactiveGraph} from '../reactive-graph/ReactiveGraph'; let groupNames = ['clean_unknown', 'clean_linux', 'clean_windows', 'exploited_linux', 'exploited_windows', 'island', 'island_monkey_linux', 'island_monkey_linux_running', 'island_monkey_windows', 'island_monkey_windows_running', @@ -26,6 +26,7 @@ let getGroupsOptions = () => { }; let options = { + autoResize: true, layout: { improvedLayout: false }, @@ -97,19 +98,19 @@ class MapPageComponent extends React.Component { selectionChanged(event) { if (event.nodes.length === 1) { console.log('selected node:', event.nodes[0]); // eslint-disable-line no-console - fetch('/api/netmap/node?id='+event.nodes[0]) + fetch('/api/netmap/node?id=' + event.nodes[0]) .then(res => res.json()) .then(res => this.setState({selected: res, selectedType: 'node'})); } else if (event.edges.length === 1) { let displayedEdge = this.state.graph.edges.find( - function(edge) { + function (edge) { return edge['id'] === event.edges[0]; }); if (displayedEdge['group'] === 'island') { this.setState({selected: displayedEdge, selectedType: 'island_edge'}); } else { - fetch('/api/netmap/edge?id='+event.edges[0]) + fetch('/api/netmap/edge?id=' + event.edges[0]) .then(res => res.json()) .then(res => this.setState({selected: res.edge, selectedType: 'edge'})); } @@ -136,7 +137,9 @@ class MapPageComponent extends React.Component {