forked from p34709852/monkey
UI: remove the broken "force kill" toggle from UI, also remove the react-toggle component since it's not used anywhere else
This commit is contained in:
parent
8cd8449f12
commit
41f6ddb5b5
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "infection-monkey",
|
||||
"version": "1.11.0",
|
||||
"version": "1.12.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -11270,14 +11270,6 @@
|
|||
"prop-types": "^15.7.2"
|
||||
}
|
||||
},
|
||||
"react-toggle": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/react-toggle/-/react-toggle-4.1.2.tgz",
|
||||
"integrity": "sha512-4Ohw31TuYQdhWfA6qlKafeXx3IOH7t4ZHhmRdwsm1fQREwOBGxJT+I22sgHqR/w8JRdk+AeMCJXPImEFSrNXow==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5"
|
||||
}
|
||||
},
|
||||
"react-tooltip-lite": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/react-tooltip-lite/-/react-tooltip-lite-1.12.0.tgz",
|
||||
|
|
|
@ -111,7 +111,6 @@
|
|||
"react-router-dom": "^5.3.0",
|
||||
"react-spinners": "^0.9.0",
|
||||
"react-table": "^6.10.3",
|
||||
"react-toggle": "^4.1.2",
|
||||
"react-tooltip-lite": "^1.12.0",
|
||||
"redux": "^4.1.1",
|
||||
"sha3": "^2.1.4",
|
||||
|
|
|
@ -20,7 +20,6 @@ import GettingStartedPage from './pages/GettingStartedPage';
|
|||
|
||||
import 'normalize.css/normalize.css';
|
||||
import 'styles/App.css';
|
||||
import 'react-toggle/style.css';
|
||||
import 'react-table/react-table.css';
|
||||
import LoadingScreen from './ui-components/LoadingScreen';
|
||||
import SidebarLayoutComponent from "./layouts/SidebarLayoutComponent";
|
||||
|
|
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
|
||||
import {faHandPointLeft} from '@fortawesome/free-solid-svg-icons/faHandPointLeft'
|
||||
import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons/faQuestionCircle'
|
||||
import Toggle from 'react-toggle';
|
||||
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
|
||||
import download from 'downloadjs'
|
||||
import AuthComponent from '../../AuthComponent';
|
||||
|
@ -67,33 +66,6 @@ class PreviewPaneComponent extends AuthComponent {
|
|||
);
|
||||
}
|
||||
|
||||
forceKill(event, asset) {
|
||||
let newConfig = asset.config;
|
||||
newConfig['alive'] = !event.target.checked;
|
||||
this.authFetch('/api/monkey/' + asset.guid,
|
||||
{
|
||||
method: 'PATCH',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({config: newConfig})
|
||||
});
|
||||
}
|
||||
|
||||
// TODO remove this
|
||||
forceKillRow(asset) {
|
||||
return (
|
||||
<tr>
|
||||
<th>
|
||||
Force Kill
|
||||
{this.generateToolTip('If this is on, monkey will die next time it communicates')}
|
||||
</th>
|
||||
<td>
|
||||
<Toggle id={asset.id} checked={!asset.config.alive} icons={false} disabled={asset.dead}
|
||||
onChange={(e) => this.forceKill(e, asset)}/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
unescapeLog(st) {
|
||||
return st.substr(1, st.length - 2) // remove quotation marks on beginning and end of string.
|
||||
|
@ -194,7 +166,6 @@ class PreviewPaneComponent extends AuthComponent {
|
|||
{this.ipsRow(asset)}
|
||||
{this.servicesRow(asset)}
|
||||
{this.accessibleRow(asset)}
|
||||
{this.forceKillRow(asset)}
|
||||
{this.downloadLogRow(asset)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue