Added title (should be event type) to report data and events timeline

This commit is contained in:
Shay Nehmad 2019-08-06 19:19:00 +03:00
parent ad5929b4e5
commit 47d37dcdd0
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,7 @@ ZERO_TRUST_REPORT_TYPE = "zero_trust"
GENERAL_REPORT_TYPE = "general" GENERAL_REPORT_TYPE = "general"
REPORT_TYPES = [GENERAL_REPORT_TYPE, ZERO_TRUST_REPORT_TYPE] REPORT_TYPES = [GENERAL_REPORT_TYPE, ZERO_TRUST_REPORT_TYPE]
__author__ = "itay.mizeretz" __author__ = ["itay.mizeretz", "shay.nehmad"]
class Report(flask_restful.Resource): class Report(flask_restful.Resource):
@ -30,9 +30,11 @@ class Report(flask_restful.Resource):
"events": [ "events": [
{ {
"timestamp": "2019-08-01 14:48:46.112000", "timestamp": "2019-08-01 14:48:46.112000",
"title": "Monkey perform an action",
"message": "log1" "message": "log1"
}, { }, {
"timestamp": "2019-08-01 14:48:42.112000", "timestamp": "2019-08-01 14:48:42.112000",
"title": "Analysis",
"message": "log2" "message": "log2"
}] }]
}, },
@ -43,6 +45,7 @@ class Report(flask_restful.Resource):
"events": [ "events": [
{ {
"timestamp": "2019-08-01 14:48:46.112000", "timestamp": "2019-08-01 14:48:46.112000",
"title": "Analysis",
"message": "log3" "message": "log3"
}] }]
} }

View File

@ -8,7 +8,13 @@ export class EventsTimeline extends Component {
<Timeline> <Timeline>
{ {
this.props["events"].map(event => ( this.props["events"].map(event => (
<TimelineEvent key={event.timestamp} createdAt={event.timestamp} title={event.message}>{event.message}</TimelineEvent> <TimelineEvent
key={event.timestamp}
createdAt={event.timestamp}
title={event.title}
icon={<i className="fa fa-circle icon-info" />}>
{event.message}
</TimelineEvent>
)) ))
} }
</Timeline> </Timeline>