forked from p15670423/monkey
Island UI: add keys to items in ransomware report, breach section
This commit is contained in:
parent
fcb52b8223
commit
e6a87839d6
|
@ -24,11 +24,13 @@ export let renderLimitedArray = function (array,
|
||||||
} else {
|
} else {
|
||||||
element = (<>{array[i]}</>);
|
element = (<>{array[i]}</>);
|
||||||
}
|
}
|
||||||
elements.push(<div className={className}>{element}</div>);
|
elements.push(<div className={className} key={array[i]}>{element}</div>);
|
||||||
}
|
}
|
||||||
let remainder = array.length - limit;
|
let remainder = array.length - limit;
|
||||||
if(remainder > 0){
|
if(remainder > 0){
|
||||||
elements.push(<div className={className}> and {remainder} more</div>);
|
elements.push(<div className={className} key={'remainder'}>
|
||||||
|
and {remainder} more
|
||||||
|
</div>);
|
||||||
}
|
}
|
||||||
return elements
|
return elements
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ function BreachSection() {
|
||||||
function getBreachSectionBody(machines) {
|
function getBreachSectionBody(machines) {
|
||||||
let machineList = [];
|
let machineList = [];
|
||||||
for(let i = 0; i < machines.length; i++){
|
for(let i = 0; i < machines.length; i++){
|
||||||
machineList.push(<li>{getMachine(machines[i])}</li>);
|
machineList.push(getMachine(machines[i]));
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={'ransomware-breach-section'}>
|
<div className={'ransomware-breach-section'}>
|
||||||
|
@ -39,10 +39,10 @@ function getBreachSectionBody(machines) {
|
||||||
|
|
||||||
function getMachine(machine) {
|
function getMachine(machine) {
|
||||||
return (
|
return (
|
||||||
<>
|
<li key={machine['hostname']}>
|
||||||
<b>{machine['hostname']}</b>
|
<b>{machine['hostname']}</b>
|
||||||
({renderLimitedArray(machine['ip_addresses'], 2, 'ip-address')}) at {machine['start_time']}
|
({renderLimitedArray(machine['ip_addresses'], 2, 'ip-address')}) at {machine['start_time']}
|
||||||
</>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue