-
- If you are finished and want to start over with a fresh configuration, erase the logs and clear the map
- you can go ahead and
-
-
- {
- this.setState({showCleanDialog: true});
- this.updateMonkeysRunning();
- }
- }>
- Reset the Environment
-
-
-
-
- You don't have to reset the environment to keep running monkeys.
- You can continue and Run More Monkeys as you wish,
- and see the results on the Infection Map without deleting anything.
-
- {this.state.cleaned ?
-
-
- Environment was reset successfully
-
- : ''}
-
-
- );
- }
-
- cleanup = () => {
- this.setState({
- cleaned: false
- });
- return this.authFetch('/api?action=reset')
- .then(res => res.json())
- .then(res => {
- if (res['status'] === 'OK') {
- this.setState({
- cleaned: true
- });
- }
- }).then(() => {
- this.updateMonkeysRunning();
- this.props.onStatusChange();
- });
- };
-
- closeModal = () => {
- this.setState({
- showCleanDialog: false
- })
- };
-}
-
-export default StartOverPageComponent;
diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx b/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx
new file mode 100644
index 000000000..15281362f
--- /dev/null
+++ b/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx
@@ -0,0 +1,130 @@
+import {Button, Col, Container, Modal, NavLink, Row} from 'react-bootstrap';
+import React, {useState} from 'react';
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
+import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons/faExclamationTriangle';
+
+import '../../styles/components/IslandResetModal.scss';
+import {Routes} from '../Main';
+import LoadingIcon from './LoadingIcon';
+import {faCheck} from '@fortawesome/free-solid-svg-icons';
+import AuthService from '../../services/AuthService';
+
+type Props = {
+ show: boolean,
+ allMonkeysAreDead: boolean,
+ onClose: () => void
+}
+
+// Button statuses
+const Idle = 1;
+const Loading = 2;
+const Done = 3;
+
+const IslandResetModal = (props: Props) => {
+
+ const [resetAllStatus, setResetAll] = useState(Idle);
+ const [deleteStatus, setDeleteStatus] = useState(Idle);
+ const auth = new AuthService();
+
+ return (
+