From 79bf05d320a0eff68f0fc989d7b89d47d638c321 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 22 Jun 2020 12:16:23 +0300 Subject: [PATCH] Rolled back merge changes that broke map page UI --- .../cc/ui/src/components/pages/MapPage.js | 106 +++++++++--------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js index 2962b839a..11c9174e9 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -1,13 +1,15 @@ import React from 'react'; -import {Col, Modal} from 'react-bootstrap'; +import {Col, Modal, Row} from 'react-bootstrap'; import {Link} from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faStopCircle } from '@fortawesome/free-solid-svg-icons/faStopCircle' -import { faMinus } from '@fortawesome/free-solid-svg-icons/faMinus' +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faStopCircle} from '@fortawesome/free-solid-svg-icons/faStopCircle'; +import {faMinus} from '@fortawesome/free-solid-svg-icons/faMinus'; import PreviewPaneComponent from 'components/map/preview-pane/PreviewPane'; import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph'; import {getOptions, edgeGroupToColor} from 'components/map/MapOptions'; import AuthComponent from '../AuthComponent'; +import '../../styles/Map.scss'; +import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; class MapPageComponent extends AuthComponent { constructor(props) { @@ -73,7 +75,7 @@ class MapPageComponent extends AuthComponent { }; updateTelemetryFromServer = () => { - if( this.state.telemetryUpdateInProgress ) { + if (this.state.telemetryUpdateInProgress) { return } this.setState({telemetryUpdateInProgress: true}); @@ -153,7 +155,6 @@ class MapPageComponent extends AuthComponent { ) - }; renderTelemetryEntry(telemetry) { @@ -174,8 +175,8 @@ class MapPageComponent extends AuthComponent { this.setState({ isScrolledUp: (element.scrollTop < this.scrollTop), - telemetryCurrentLine: Math.trunc(element.scrollTop/telemetryLineHeight)+1, - telemetryLines: Math.trunc(element.scrollHeight/telemetryLineHeight) + telemetryCurrentLine: Math.trunc(element.scrollTop / telemetryLineHeight) + 1, + telemetryLines: Math.trunc(element.scrollHeight / telemetryLineHeight) }); } @@ -199,52 +200,53 @@ class MapPageComponent extends AuthComponent { render() { return ( -
- {this.renderKillDialogModal()} - -

3. Infection Map

- - -
- Legend: - Exploit - | - Scan - | - Tunnel - | - Island Communication -
- {this.renderTelemetryConsole()} -
- -
- {this.renderTelemetryLineCount()} - - - - -
- Monkey - Telemetry - -
- {this.state.killPressed ? -
- - Kill command sent to all monkeys + + + {this.renderKillDialogModal()} + +

3. Infection Map

+ + +
+ Legend: + Exploit + | + Scan + | + Tunnel + | + Island Communication
- : ''} +
+ {this.renderTelemetryLineCount()} + {this.renderTelemetryConsole()} + +
+ + +
+ Monkey + Telemetry + +
+ {this.state.killPressed ? +
+ + Kill command sent to all monkeys +
+ : ''} - - -
+ + + + ); } }