diff --git a/bin/lib/Tag.py b/bin/lib/Tag.py
index 1dacbfe8..15edcd0a 100755
--- a/bin/lib/Tag.py
+++ b/bin/lib/Tag.py
@@ -1558,14 +1558,14 @@ def get_obj_date(object_type, object_id):
return None
# API QUERY
-def api_delete_obj_tags(tags=[], object_id=None, object_type="item"):
+def api_delete_obj_tags(tags=[], object_id=None, object_type="item", subtype=''):
if not object_id:
return ({'status': 'error', 'reason': 'object id not found'}, 404)
if not tags:
return ({'status': 'error', 'reason': 'No Tag(s) specified'}, 400)
for tag in tags:
- res = delete_object_tag(tag, object_type, object_id, subtype='')
+ res = delete_object_tag(tag, object_type, object_id, subtype=subtype)
if res:
return res
diff --git a/bin/lib/objects/Chats.py b/bin/lib/objects/Chats.py
index dde776b0..0e6dadd0 100755
--- a/bin/lib/objects/Chats.py
+++ b/bin/lib/objects/Chats.py
@@ -51,7 +51,7 @@ class Chat(AbstractChatObject):
def get_link(self, flask_context=False):
if flask_context:
- url = url_for('correlation.show_correlation', type=self.type, subtype=self.subtype, id=self.id)
+ url = url_for('chats_explorer.chats_explorer_chat', subtype=self.subtype, id=self.id)
else:
url = f'{baseurl}/correlation/show?type={self.type}&subtype={self.subtype}&id={self.id}'
return url
diff --git a/bin/lib/objects/ail_objects.py b/bin/lib/objects/ail_objects.py
index 63248a79..14a035a4 100755
--- a/bin/lib/objects/ail_objects.py
+++ b/bin/lib/objects/ail_objects.py
@@ -254,8 +254,9 @@ def get_objects_meta(objs, options=set(), flask_context=False):
def get_object_card_meta(obj_type, subtype, id, related_btc=False):
obj = get_object(obj_type, subtype, id)
- meta = obj.get_meta()
- meta['icon'] = obj.get_svg_icon()
+ meta = obj.get_meta(options={'icon', 'info', 'nb_participants'})
+ # meta['icon'] = obj.get_svg_icon()
+ meta['svg_icon'] = obj.get_svg_icon()
if subtype or obj_type == 'cookie-name' or obj_type == 'cve' or obj_type == 'etag' or obj_type == 'title' or obj_type == 'favicon' or obj_type == 'hhhash':
meta['sparkline'] = obj.get_sparkline()
if obj_type == 'cve':
diff --git a/var/www/blueprints/chats_explorer.py b/var/www/blueprints/chats_explorer.py
index e24abe82..3363a29b 100644
--- a/var/www/blueprints/chats_explorer.py
+++ b/var/www/blueprints/chats_explorer.py
@@ -92,7 +92,9 @@ def chats_explorer_chat():
else:
chat = chat[0]
languages = Language.get_translation_languages()
- return render_template('chat_viewer.html', chat=chat, bootstrap_label=bootstrap_label, translation_languages=languages, translation_target=target)
+ return render_template('chat_viewer.html', chat=chat, bootstrap_label=bootstrap_label,
+ ail_tags=Tag.get_modal_add_tags(chat['id'], chat['type'], chat['subtype']),
+ translation_languages=languages, translation_target=target)
@chats_explorer.route("chats/explorer/messages/stats/week", methods=['GET'])
@login_required
diff --git a/var/www/blueprints/tags_ui.py b/var/www/blueprints/tags_ui.py
index f833ab16..2bf7faef 100644
--- a/var/www/blueprints/tags_ui.py
+++ b/var/www/blueprints/tags_ui.py
@@ -170,7 +170,11 @@ def tag_confirm():
if not obj.exists():
abort(404)
Tag.confirm_tag(tag, obj)
- return redirect(obj.get_link(flask_context=True))
+
+ if request.referrer:
+ return redirect(request.referrer)
+ else:
+ return redirect(obj.get_link(flask_context=True))
@tags_ui.route('/tag/add_tags')
@login_required
@@ -192,22 +196,27 @@ def add_tags():
if res[1] != 200:
return str(res[0])
- return redirect(ail_objects.get_object_link(object_type, object_subtype, object_id, flask_context=True))
+ if request.referrer:
+ return redirect(request.referrer)
+ else:
+ return redirect(ail_objects.get_object_link(object_type, object_subtype, object_id, flask_context=True))
-@tags_ui.route('/tag/delete_tag')
+@tags_ui.route('/tag/delete_tag') # TODO FIX REQUEST PARAMETER
@login_required
@login_analyst
def delete_tag():
-
- object_type = request.args.get('object_type')
- object_id = request.args.get('object_id')
- subtype = '' # TODO: handle subtype object
+ object_type = request.args.get('type')
+ subtype = request.args.get('subtype', '')
+ object_id = request.args.get('id')
tag = request.args.get('tag')
- res = Tag.api_delete_obj_tags(tags=[tag], object_id=object_id, object_type=object_type)
+ res = Tag.api_delete_obj_tags(tags=[tag], object_id=object_id, object_type=object_type, subtype=subtype)
if res[1] != 200:
return str(res[0])
- return redirect(ail_objects.get_object_link(object_type, subtype, object_id, flask_context=True))
+ if request.referrer:
+ return redirect(request.referrer)
+ else:
+ return redirect(ail_objects.get_object_link(object_type, subtype, object_id, flask_context=True))
@tags_ui.route('/tag/get_all_tags')
diff --git a/var/www/templates/chats_explorer/basic_card_chat.html b/var/www/templates/chats_explorer/basic_card_chat.html
new file mode 100644
index 00000000..6598a472
--- /dev/null
+++ b/var/www/templates/chats_explorer/basic_card_chat.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ {% if meta["tags_safe"] %}
+ {% if meta['icon'] %}
+
+ {% endif %}
+ {% else %}
+
+
+
+
+ {% endif %}
+
+
+
+
+
+
+
+ {{meta["first_seen"]}}
+
+
+
+ {{meta["last_seen"]}}
+
+
+
+
+
+
+
+
+ {{meta["nb_subchannels"]}}
+
+
+
+ {{meta["nb_participants"]}}
+
+
+
+
+ {% for tag in meta['tags'] %}
+ {{ tag }}
+ {% endfor %}
+
+
+
+ {% include 'objects/block_object_footer_small.html' %}
+
\ No newline at end of file
diff --git a/var/www/templates/chats_explorer/card_chat.html b/var/www/templates/chats_explorer/card_chat.html
new file mode 100644
index 00000000..982297b9
--- /dev/null
+++ b/var/www/templates/chats_explorer/card_chat.html
@@ -0,0 +1,88 @@
+
+
+
+{% with modal_add_tags=ail_tags %}
+ {% include 'modals/add_tags.html' %}
+{% endwith %}
+
+{% include 'modals/edit_tag.html' %}
+
+
+
+
+
\ No newline at end of file
diff --git a/var/www/templates/chats_explorer/card_image.html b/var/www/templates/chats_explorer/card_image.html
index 058e3c0d..9e382aea 100644
--- a/var/www/templates/chats_explorer/card_image.html
+++ b/var/www/templates/chats_explorer/card_image.html
@@ -13,7 +13,7 @@
}
-