diff --git a/monkey_island/cc/ui/package.json b/monkey_island/cc/ui/package.json index e47f4bae0..64d7643ce 100644 --- a/monkey_island/cc/ui/package.json +++ b/monkey_island/cc/ui/package.json @@ -76,6 +76,7 @@ "react-graph-vis": "^0.1.3", "react-json-tree": "^0.10.9", "react-jsonschema-form": "^0.50.1", + "react-modal-dialog": "^4.0.7", "react-redux": "^5.0.6", "react-router-dom": "^4.2.2", "react-toggle": "^4.0.1", diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index 4fe280714..1433ac515 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -4,6 +4,7 @@ import {Link} from 'react-router-dom'; import {Icon} from 'react-fa'; import PreviewPane from 'components/preview-pane/PreviewPane'; import {ReactiveGraph} from '../reactive-graph/ReactiveGraph'; +import {ModalContainer, ModalDialog} from 'react-modal-dialog'; 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', @@ -52,7 +53,8 @@ class MapPageComponent extends React.Component { graph: {nodes: [], edges: []}, selected: null, selectedType: null, - killPressed: false + killPressed: false, + showKillDialog: false }; } @@ -127,9 +129,38 @@ class MapPageComponent extends React.Component { .then(res => this.setState({killPressed: (res.status === 'OK')})); }; + renderKillDialogModal = () => { + if (!this.state.showKillDialog) { + return
+ } + + return ( ++ Are you sure you want to kill all monkeys? +
+ + +