Extracted the security issues glance component

This commit is contained in:
Shay Nehmad 2019-08-15 10:17:38 +03:00
parent cd7cc4011d
commit 785bc4f109
2 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,4 @@
import React, {Component} from 'react';
import React from 'react';
import {Button, Col} from 'react-bootstrap';
import BreachedServers from 'components/report-components/security/BreachedServers';
import ScannedServers from 'components/report-components/security/ScannedServers';
@ -16,11 +16,11 @@ import ReportHeader, {ReportTypes} from "../report-components/common/ReportHeade
import {MonkeysStillAliveWarning} from "../report-components/common/MonkeysStillAliveWarning";
import ReportLoader from "../report-components/common/ReportLoader";
import MustRunMonkeyWarning from "../report-components/common/MustRunMonkeyWarning";
import {SecurityIssuesGlance} from "../report-components/common/SecurityIssuesGlance";
let guardicoreLogoImage = require('../../images/guardicore-logo.png');
class ReportPageComponent extends AuthComponent {
Issue =
@ -165,17 +165,7 @@ class ReportPageComponent extends AuthComponent {
<h2>
Overview
</h2>
{
this.state.report.glance.exploited.length > 0 ?
(<p className="alert alert-danger">
<i className="glyphicon glyphicon-exclamation-sign" style={{'marginRight': '5px'}}/>
Critical security issues were detected!
</p>) :
(<p className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
No critical security issues were detected.
</p>)
}
<SecurityIssuesGlance issuesFound={this.state.report.glance.exploited.length > 0}/>
<MonkeysStillAliveWarning allMonkeysAreDead={this.state.allMonkeysAreDead}/>
{
this.state.report.glance.exploited.length > 0 ?

View File

@ -0,0 +1,22 @@
import React, {Component, Fragment} from "react";
import * as PropTypes from "prop-types";
export class SecurityIssuesGlance extends Component {
render() {
return <Fragment>
{
this.props.issuesFound ?
(<p className="alert alert-danger">
<i className="glyphicon glyphicon-exclamation-sign" style={{'marginRight': '5px'}}/>
Critical security issues were detected!
</p>) :
(<p className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
No critical security issues were detected.
</p>)
}
</Fragment>
}
}
SecurityIssuesGlance.propTypes = {issuesFound: PropTypes.bool};