diff --git a/monkey/monkey_island/cc/ui/src/components/Main.js b/monkey/monkey_island/cc/ui/src/components/Main.js index 37eb97f3f..7df443e6e 100644 --- a/monkey/monkey_island/cc/ui/src/components/Main.js +++ b/monkey/monkey_island/cc/ui/src/components/Main.js @@ -5,7 +5,6 @@ import {Container} from 'react-bootstrap'; import RunServerPage from 'components/pages/RunServerPage'; import ConfigurePage from 'components/pages/ConfigurePage'; import RunMonkeyPage from 'components/pages/RunMonkeyPage/RunMonkeyPage'; -import RunMonkeyPage2 from 'components/pages/RunMonkeyPage/RunMonkeyPage2'; import MapPage from 'components/pages/MapPage'; import TelemetryPage from 'components/pages/TelemetryPage'; import StartOverPage from 'components/pages/StartOverPage'; @@ -149,10 +148,6 @@ class AppComponent extends AuthComponent { )} - {this.renderRoute('/run-monkey2', - )} {this.renderRoute('/infection/map', { - return InlineSelection(getContents, props) + return InlineSelection(getContents, { + ...props, + onBackButtonClick: () => {props.setComponent()} + }) } const getContents = (props) => { @@ -35,12 +39,12 @@ const getContents = (props) => { } function generateCommands() { - if(osType === OS_TYPES.WINDOWS_64 || osType === OS_TYPES.WINDOWS_32) { + if (osType === OS_TYPES.WINDOWS_64 || osType === OS_TYPES.WINDOWS_32) { return [{type: 'CMD', command: GenerateLocalWindowsCmd(selectedIp, osType)}, - {type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, osType)}] + {type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, osType)}] } else { return [{type: 'CURL', command: GenerateLocalLinuxCurl(selectedIp, osType)}, - {type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, osType)}] + {type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, osType)}] } } diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js index d428c68ee..a699b7d7f 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js @@ -1,7 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import BackButton from './BackButton'; -import ManualRunOptions from '../../pages/RunMonkeyPage/RunOptions'; import {Col, Row, Container} from 'react-bootstrap'; @@ -21,22 +20,11 @@ export default function InlineSelection(WrappedComponent, props) { function renderBackButton(props){ if(props.onBackButtonClick !== undefined){ return (); - } else if(props.previousComponent === undefined){ - return ( {setPreviousComponent(props, props.previousComponent)}}/>); - } -} - -function setPreviousComponent(props) { - if (props.previousComponent === ManualRunOptions) { - return props.setComponent() - } else { - return props.setComponent(props.previousComponent, props) } } InlineSelection.propTypes = { setComponent: PropTypes.func, ips: PropTypes.arrayOf(PropTypes.string), - previousComponent: PropTypes.object, onBackButtonClick: PropTypes.func }