Island: Extract getScannedVsExploitedStats() method

This commit is contained in:
Mike Salvatore 2021-07-12 12:41:42 -04:00
parent 6fdf0858ac
commit ced3c3b137
1 changed files with 13 additions and 7 deletions

View File

@ -18,23 +18,29 @@ class RansomwareReport extends React.Component {
} }
getExploitationStats() { getExploitationStats() {
let num_scanned = this.props.report.propagation_stats.num_scanned_nodes;
let num_exploited = this.props.report.propagation_stats.num_exploited_nodes;
return ( return (
<div> <div>
<h2> <h2>
Propagation Propagation
</h2> </h2>
<p> {this.getScannedVsExploitedStats()}
The Monkey discovered <span className='badge badge-warning'>{num_scanned}</span> machines
and successfully breached <span className='badge badge-danger'>{num_exploited}</span> of them.
</p>
{this.getExploitationStatsPerExploit()} {this.getExploitationStatsPerExploit()}
</div> </div>
) )
} }
getScannedVsExploitedStats() {
let num_scanned = this.props.report.propagation_stats.num_scanned_nodes;
let num_exploited = this.props.report.propagation_stats.num_exploited_nodes;
return(
<p>
The Monkey discovered <span className='badge badge-warning'>{num_scanned}</span> machines
and successfully breached <span className='badge badge-danger'>{num_exploited}</span> of them.
</p>
)
}
getExploitationStatsPerExploit() { getExploitationStatsPerExploit() {
let exploit_counts = this.props.report.propagation_stats.num_exploited_per_exploit; let exploit_counts = this.props.report.propagation_stats.num_exploited_per_exploit;