forked from p15670423/monkey
Island: Use Pluralize to display ransomware propagation stats
This commit is contained in:
parent
c8e0104985
commit
50c24c77f4
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
|
|
||||||
import ReportHeader, {ReportTypes} from './common/ReportHeader';
|
import ReportHeader, {ReportTypes} from './common/ReportHeader';
|
||||||
import ReportLoader from './common/ReportLoader';
|
import ReportLoader from './common/ReportLoader';
|
||||||
|
import pluralize from 'pluralize'
|
||||||
|
|
||||||
class RansomwareReport extends React.Component {
|
class RansomwareReport extends React.Component {
|
||||||
stillLoadingDataFromServer() {
|
stillLoadingDataFromServer() {
|
||||||
|
@ -41,22 +42,13 @@ class RansomwareReport extends React.Component {
|
||||||
|
|
||||||
for (let exploit in exploit_counts) {
|
for (let exploit in exploit_counts) {
|
||||||
let count = exploit_counts[exploit];
|
let count = exploit_counts[exploit];
|
||||||
if (count === 1) {
|
exploitation_details.push(
|
||||||
exploitation_details.push(
|
<div>
|
||||||
<div>
|
<span className='badge badge-danger'>{count}</span>
|
||||||
<span className='badge badge-danger'>{count}</span> machine was exploited by
|
{pluralize('machine', count)} {pluralize('was', count)} exploited by the
|
||||||
the <span className='badge badge-danger'>{exploit}</span>.
|
<span className='badge badge-danger'>{exploit}</span>.
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else {
|
|
||||||
exploitation_details.push(
|
|
||||||
<div>
|
|
||||||
<span className='badge badge-danger'>{count}</span> machines were exploited by
|
|
||||||
the <span className='badge badge-danger'>{exploit}</span>.
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return exploitation_details;
|
return exploitation_details;
|
||||||
|
|
Loading…
Reference in New Issue