From 9c1abf08a91d85c266a50ed8973b27b40f143f8a Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 7 Aug 2019 11:08:30 +0300 Subject: [PATCH] Added event type and custom icons per type --- monkey/monkey_island/cc/resources/reporting/report.py | 5 ++++- .../report-components/zerotrust/EventsTimeline.js | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/resources/reporting/report.py b/monkey/monkey_island/cc/resources/reporting/report.py index 55c7766be..3fe8f0fd9 100644 --- a/monkey/monkey_island/cc/resources/reporting/report.py +++ b/monkey/monkey_island/cc/resources/reporting/report.py @@ -30,11 +30,13 @@ class Report(flask_restful.Resource): "events": [ { "timestamp": "2019-08-01 14:48:46.112000", - "title": "Monkey perform an action", + "title": "Monkey performed an action", + "type": "MonkeyAction", "message": "log1" }, { "timestamp": "2019-08-01 14:48:42.112000", "title": "Analysis", + "type": "IslandAction", "message": "log2" }] }, @@ -46,6 +48,7 @@ class Report(flask_restful.Resource): { "timestamp": "2019-08-01 14:48:46.112000", "title": "Analysis", + "type": "MonkeyAction", "message": "log3" }] } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsTimeline.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsTimeline.js index 441a01636..ec0842309 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsTimeline.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsTimeline.js @@ -1,6 +1,12 @@ import React, {Component} from "react"; import {Timeline, TimelineEvent} from "react-event-timeline"; +const eventTypeToIcon = { + "MonkeyAction": "fa fa-exclamation-circle fa-2x icon-warning", + "IslandAction": "fa fa-server fa-2x icon-info", + null: "fa fa-question-circle fa-2x icon-info", +}; + export class EventsTimeline extends Component { render() { return ( @@ -12,7 +18,7 @@ export class EventsTimeline extends Component { key={event.timestamp} createdAt={event.timestamp} title={event.title} - icon={}> + icon={}> {event.message} ))