ui: use template strings when generating cross-segment report

This commit is contained in:
Mike Salvatore 2021-02-02 06:49:21 -05:00
parent c8b4089bd2
commit 458e01cf24
1 changed files with 5 additions and 4 deletions

View File

@ -451,7 +451,8 @@ class ReportPageComponent extends AuthComponent {
} }
generateCrossSegmentIssue(crossSegmentIssue) { generateCrossSegmentIssue(crossSegmentIssue) {
let crossSegmentIssueOverview = 'Communication possible from ' + crossSegmentIssue['source_subnet'] + ' to ' + crossSegmentIssue['target_subnet'] let crossSegmentIssueOverview = 'Communication possible from '
+ `${crossSegmentIssue['source_subnet']} to ${crossSegmentIssue['target_subnet']}`;
return ( return (
<li key={crossSegmentIssueOverview}> <li key={crossSegmentIssueOverview}>
@ -476,7 +477,7 @@ class ReportPageComponent extends AuthComponent {
generateCrossSegmentSingleHostMessage(issue) { generateCrossSegmentSingleHostMessage(issue) {
return ( return (
<li key={issue['hostname']}> <li key={issue['hostname']}>
{'Machine ' + issue['hostname'] + ' has both ips: ' + issue['source'] + ' and ' + issue['target']} {`Machine ${issue['hostname']} has both ips: ${issue['source']} and ${issue['target']}`}
</li> </li>
); );
} }
@ -495,8 +496,8 @@ class ReportPageComponent extends AuthComponent {
generateCrossSegmentServiceMessage(issue) { generateCrossSegmentServiceMessage(issue) {
return ( return (
'IP ' + issue['source'] + ' (' + issue['hostname'] + ') connected to IP ' + issue['target'] `IP ${issue['source']} (${issue['hostname']}) connected to IP ${issue['target']}`
+ ' using the services: ' + Object.keys(issue['services']).join(', ') + ` using the services: ${Object.keys(issue['services']).join(', ')}`
); );
} }