From b81d70172c48644090a038018de14a8d5796f9a0 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 21 Jun 2021 17:25:12 +0200 Subject: [PATCH] fix: [Trackers UI] fix sources logo + tracker metadata --- var/www/modules/hunter/Flask_hunter.py | 10 +++++----- var/www/modules/hunter/templates/edit_tracker.html | 8 +++++++- var/www/modules/hunter/templates/showTracker.html | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/var/www/modules/hunter/Flask_hunter.py b/var/www/modules/hunter/Flask_hunter.py index 41d1dff1..e9dd97d1 100644 --- a/var/www/modules/hunter/Flask_hunter.py +++ b/var/www/modules/hunter/Flask_hunter.py @@ -192,8 +192,8 @@ def edit_tracked_menu(): @login_read_only def show_tracker(): user_id = current_user.get_id() - term_uuid = request.args.get('uuid', None) - res = Term.check_term_uuid_valid_access(term_uuid, user_id) + tracker_uuid = request.args.get('uuid', None) + res = Term.check_term_uuid_valid_access(tracker_uuid, user_id) if res: # invalid access return Response(json.dumps(res[0], indent=2, sort_keys=True), mimetype='application/json'), res[1] @@ -205,15 +205,15 @@ def show_tracker(): if date_to: date_to = date_to.replace('-', '') - tracker_metadata = Tracker.get_tracker_metedata(term_uuid, user_id=True, level=True, description=True, tags=True, mails=True, sources=True, sparkline=True) + tracker_metadata = Tracker.get_tracker_metedata(tracker_uuid, user_id=True, level=True, description=True, tags=True, mails=True, sources=True, sparkline=True) if tracker_metadata['type'] == 'yara': - yara_rule_content = Tracker.get_yara_rule_content(tracker_metadata['term']) + yara_rule_content = Tracker.get_yara_rule_content(tracker_metadata['tracker']) else: yara_rule_content = None if date_from: - res = Term.parse_get_tracker_term_item({'uuid': term_uuid, 'date_from': date_from, 'date_to': date_to}, user_id) + res = Term.parse_get_tracker_term_item({'uuid': tracker_uuid, 'date_from': date_from, 'date_to': date_to}, user_id) if res[1] !=200: return Response(json.dumps(res[0], indent=2, sort_keys=True), mimetype='application/json'), res[1] tracker_metadata['items'] = res[0]['items'] diff --git a/var/www/modules/hunter/templates/edit_tracker.html b/var/www/modules/hunter/templates/edit_tracker.html index 1f60177b..8d91c54b 100644 --- a/var/www/modules/hunter/templates/edit_tracker.html +++ b/var/www/modules/hunter/templates/edit_tracker.html @@ -61,7 +61,13 @@ - +
+
+
+
+ +
+
diff --git a/var/www/modules/hunter/templates/showTracker.html b/var/www/modules/hunter/templates/showTracker.html index 642a2aac..bcaeb7dc 100644 --- a/var/www/modules/hunter/templates/showTracker.html +++ b/var/www/modules/hunter/templates/showTracker.html @@ -81,7 +81,7 @@ {{ tracker_metadata['type'] }} - {{ tracker_metadata['term'] }} + {{ tracker_metadata['tracker'] }} {{ tracker_metadata['date'][0:4] }}/{{ tracker_metadata['date'][4:6] }}/{{ tracker_metadata['date'][6:8] }} {{ tracker_metadata['level'] }} {{ tracker_metadata['user_id'] }}