"" to '' fixes for travis

This commit is contained in:
VakarisZ 2019-12-03 16:23:59 +02:00
parent ce0b15d801
commit 9dc8749550
3 changed files with 34 additions and 35 deletions

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import {BrowserRouter as Router, NavLink, Redirect, Route, Switch, withRouter} from 'react-router-dom'; import {BrowserRouter as Router, NavLink, Redirect, Route, Switch} from 'react-router-dom';
import {Col, Grid, Row} from 'react-bootstrap'; import {Col, Grid, Row} from 'react-bootstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCheck, faUndo } from '@fortawesome/free-solid-svg-icons' import { faCheck, faUndo } from '@fortawesome/free-solid-svg-icons'
@ -11,7 +11,6 @@ import MapPage from 'components/pages/MapPage';
import TelemetryPage from 'components/pages/TelemetryPage'; import TelemetryPage from 'components/pages/TelemetryPage';
import StartOverPage from 'components/pages/StartOverPage'; import StartOverPage from 'components/pages/StartOverPage';
import ReportPage from 'components/pages/ReportPage'; import ReportPage from 'components/pages/ReportPage';
import ZeroTrustReportPage from 'components/report-components/ZeroTrustReport';
import LicensePage from 'components/pages/LicensePage'; import LicensePage from 'components/pages/LicensePage';
import AuthComponent from 'components/AuthComponent'; import AuthComponent from 'components/AuthComponent';
import LoginPageComponent from 'components/pages/LoginPage'; import LoginPageComponent from 'components/pages/LoginPage';
@ -84,7 +83,7 @@ class AppComponent extends AuthComponent {
}; };
redirectTo = (userPath, targetPath) => { redirectTo = (userPath, targetPath) => {
let pathQuery = new RegExp(userPath+"[\/]?$", "g"); let pathQuery = new RegExp(userPath+'[\/]?$', 'g');
if(window.location.pathname.match(pathQuery)){ if(window.location.pathname.match(pathQuery)){
return <Redirect to={{pathname: targetPath}}/> return <Redirect to={{pathname: targetPath}}/>
} }
@ -123,57 +122,57 @@ class AppComponent extends AuthComponent {
<Router> <Router>
<Grid fluid={true}> <Grid fluid={true}>
<Row> <Row>
<Col sm={3} md={2} className="sidebar"> <Col sm={3} md={2} className='sidebar'>
<div className="header"> <div className='header'>
<img src={logoImage} style={{width: '5vw', margin: '15px'}}/> <img src={logoImage} style={{width: '5vw', margin: '15px'}}/>
<img src={infectionMonkeyImage} style={{width: '15vw'}} alt="Infection Monkey"/> <img src={infectionMonkeyImage} style={{width: '15vw'}} alt='Infection Monkey'/>
</div> </div>
<ul className="navigation"> <ul className='navigation'>
<li> <li>
<NavLink to="/" exact={true}> <NavLink to='/' exact={true}>
<span className="number">1.</span> <span className='number'>1.</span>
Run Monkey Island Server Run Monkey Island Server
{this.state.completedSteps.run_server ? {this.state.completedSteps.run_server ?
<FontAwesomeIcon icon={faCheck} className="pull-right checkmark text-success"/> <FontAwesomeIcon icon={faCheck} className='pull-right checkmark text-success'/>
: ''} : ''}
</NavLink> </NavLink>
</li> </li>
<li> <li>
<NavLink to="/run-monkey"> <NavLink to='/run-monkey'>
<span className="number">2.</span> <span className='number'>2.</span>
Run Monkey Run Monkey
{this.state.completedSteps.run_monkey ? {this.state.completedSteps.run_monkey ?
<FontAwesomeIcon icon={faCheck} className="pull-right checkmark text-success"/> <FontAwesomeIcon icon={faCheck} className='pull-right checkmark text-success'/>
: ''} : ''}
</NavLink> </NavLink>
</li> </li>
<li> <li>
<NavLink to="/infection/map"> <NavLink to='/infection/map'>
<span className="number">3.</span> <span className='number'>3.</span>
Infection Map Infection Map
{this.state.completedSteps.infection_done ? {this.state.completedSteps.infection_done ?
<FontAwesomeIcon icon={faCheck} className="pull-right checkmark text-success"/> <FontAwesomeIcon icon={faCheck} className='pull-right checkmark text-success'/>
: ''} : ''}
</NavLink> </NavLink>
</li> </li>
<li> <li>
<NavLink to="/report/security" <NavLink to='/report/security'
isActive={(match, location) => { isActive={(match, location) => {
return (location.pathname === '/report/attack' return (location.pathname === '/report/attack'
|| location.pathname === '/report/zeroTrust' || location.pathname === '/report/zeroTrust'
|| location.pathname === '/report/security') || location.pathname === '/report/security')
}}> }}>
<span className="number">4.</span> <span className='number'>4.</span>
Security Reports Security Reports
{this.state.completedSteps.report_done ? {this.state.completedSteps.report_done ?
<FontAwesomeIcon icon={faCheck} className="pull-right checkmark text-success"/> <FontAwesomeIcon icon={faCheck} className='pull-right checkmark text-success'/>
: ''} : ''}
</NavLink> </NavLink>
</li> </li>
<li> <li>
<NavLink to="/start-over"> <NavLink to='/start-over'>
<span className="number"><FontAwesomeIcon icon={faUndo} style={{'marginLeft': '-1px'}}/></span> <span className='number'><FontAwesomeIcon icon={faUndo} style={{'marginLeft': '-1px'}}/></span>
Start Over Start Over
</NavLink> </NavLink>
</li> </li>
@ -181,23 +180,23 @@ class AppComponent extends AuthComponent {
<hr/> <hr/>
<ul> <ul>
<li><NavLink to="/configure">Configuration</NavLink></li> <li><NavLink to='/configure'>Configuration</NavLink></li>
<li><NavLink to="/infection/telemetry">Log</NavLink></li> <li><NavLink to='/infection/telemetry'>Log</NavLink></li>
</ul> </ul>
<hr/> <hr/>
<div className="guardicore-link text-center" style={{'marginBottom': '0.5em'}}> <div className='guardicore-link text-center' style={{'marginBottom': '0.5em'}}>
<span>Powered by</span> <span>Powered by</span>
<a href="http://www.guardicore.com" target="_blank"> <a href='http://www.guardicore.com' target='_blank'>
<img src={guardicoreLogoImage} alt="GuardiCore"/> <img src={guardicoreLogoImage} alt='GuardiCore'/>
</a> </a>
</div> </div>
<div className="license-link text-center"> <div className='license-link text-center'>
<NavLink to="/license">License</NavLink> <NavLink to='/license'>License</NavLink>
</div> </div>
<VersionComponent/> <VersionComponent/>
</Col> </Col>
<Col sm={9} md={10} smOffset={3} mdOffset={2} className="main"> <Col sm={9} md={10} smOffset={3} mdOffset={2} className='main'>
<Route path='/login' render={() => (<LoginPageComponent onStatusChange={this.updateStatus}/>)}/> <Route path='/login' render={() => (<LoginPageComponent onStatusChange={this.updateStatus}/>)}/>
{this.renderRoute('/', <RunServerPage onStatusChange={this.updateStatus}/>, true)} {this.renderRoute('/', <RunServerPage onStatusChange={this.updateStatus}/>, true)}
{this.renderRoute('/configure', <ConfigurePage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/configure', <ConfigurePage onStatusChange={this.updateStatus}/>)}

View File

@ -15,7 +15,7 @@ import ReportLoader from './common/ReportLoader';
const techComponents = getAllAttackModules(); const techComponents = getAllAttackModules();
function getAllAttackModules() { function getAllAttackModules() {
let context = require.context("../attack/techniques/", false, /\.js$/); let context = require.context('../attack/techniques/', false, /\.js$/);
let obj = {}; let obj = {};
context.keys().forEach(function (key) { context.keys().forEach(function (key) {
let techName = key.replace(/\.js/, ''); let techName = key.replace(/\.js/, '');
@ -68,11 +68,11 @@ class AttackReport extends React.Component {
static getStatusIcon(tech_id, techniques){ static getStatusIcon(tech_id, techniques){
switch (techniques[tech_id].status){ switch (techniques[tech_id].status){
case ScanStatus.SCANNED: case ScanStatus.SCANNED:
return <FontAwesomeIcon icon={faEye} className={"technique-status-icon"}/>; return <FontAwesomeIcon icon={faEye} className={'technique-status-icon'}/>;
case ScanStatus.USED: case ScanStatus.USED:
return <FontAwesomeIcon icon={faRadiation} className={"technique-status-icon"}/>; return <FontAwesomeIcon icon={faRadiation} className={'technique-status-icon'}/>;
default: default:
return <FontAwesomeIcon icon={faEyeSlash} className={"technique-status-icon"}/>; return <FontAwesomeIcon icon={faEyeSlash} className={'technique-status-icon'}/>;
} }
} }

View File

@ -112,8 +112,8 @@ class TechniqueDropdowns extends React.Component{
className={classNames({'toggle-btn': true, className={classNames({'toggle-btn': true,
'toggled-off' : this.state.techniquesHidden, 'toggled-off' : this.state.techniquesHidden,
'toggled-on': !this.state.techniquesHidden})}> 'toggled-on': !this.state.techniquesHidden})}>
<FontAwesomeIcon icon={faToggleOn} className={'switch-on'} size={"2x"}/> <FontAwesomeIcon icon={faToggleOn} className={'switch-on'} size={'2x'}/>
<FontAwesomeIcon icon={faToggleOn} className={'switch-off'} size={"2x"}/> <FontAwesomeIcon icon={faToggleOn} className={'switch-off'} size={'2x'}/>
</Button> </Button>
</h3> </h3>
<section className={`dropdown-list ${listClass}`}>{content}</section> <section className={`dropdown-list ${listClass}`}>{content}</section>