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 {
|
||||
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;
|
||||
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
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ function BreachSection() {
|
|||
function getBreachSectionBody(machines) {
|
||||
let machineList = [];
|
||||
for(let i = 0; i < machines.length; i++){
|
||||
machineList.push(<li>{getMachine(machines[i])}</li>);
|
||||
machineList.push(getMachine(machines[i]));
|
||||
}
|
||||
return (
|
||||
<div className={'ransomware-breach-section'}>
|
||||
|
@ -39,10 +39,10 @@ function getBreachSectionBody(machines) {
|
|||
|
||||
function getMachine(machine) {
|
||||
return (
|
||||
<>
|
||||
<li key={machine['hostname']}>
|
||||
<b>{machine['hostname']}</b>
|
||||
({renderLimitedArray(machine['ip_addresses'], 2, 'ip-address')}) at {machine['start_time']}
|
||||
</>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue