From ced3c3b137c9c2cca3963133969394aab291bad0 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 12 Jul 2021 12:41:42 -0400 Subject: [PATCH] Island: Extract getScannedVsExploitedStats() method --- .../report-components/RansomwareReport.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js index 07a6ceb15..bb24dcaa1 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js @@ -18,23 +18,29 @@ class RansomwareReport extends React.Component { } getExploitationStats() { - let num_scanned = this.props.report.propagation_stats.num_scanned_nodes; - let num_exploited = this.props.report.propagation_stats.num_exploited_nodes; - return (

Propagation

-

- The Monkey discovered {num_scanned} machines - and successfully breached {num_exploited} of them. -

+ {this.getScannedVsExploitedStats()} {this.getExploitationStatsPerExploit()}
) } + getScannedVsExploitedStats() { + let num_scanned = this.props.report.propagation_stats.num_scanned_nodes; + let num_exploited = this.props.report.propagation_stats.num_exploited_nodes; + + return( +

+ The Monkey discovered {num_scanned} machines + and successfully breached {num_exploited} of them. +

+ ) + } + getExploitationStatsPerExploit() { let exploit_counts = this.props.report.propagation_stats.num_exploited_per_exploit;