From 2b23d993df9a3ea8c4920edca102a00e17a66574 Mon Sep 17 00:00:00 2001 From: terrtia Date: Fri, 26 Apr 2024 11:52:17 +0200 Subject: [PATCH] chg: [correlation graph] add date first/last seen separator + fix display of ocr object tags --- bin/lib/objects/Ocrs.py | 1 + var/www/blueprints/objects_ocr.py | 1 + var/www/templates/correlation/show_correlation.html | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/lib/objects/Ocrs.py b/bin/lib/objects/Ocrs.py index 32686db3..3fb08575 100755 --- a/bin/lib/objects/Ocrs.py +++ b/bin/lib/objects/Ocrs.py @@ -148,6 +148,7 @@ def get_meta(self, options=None, translation_target=''): if options is None: options = set() meta = self._get_meta(options=options) + meta['tags'] = self.get_tags() meta['content'] = self.get_content() # optional meta fields diff --git a/var/www/blueprints/objects_ocr.py b/var/www/blueprints/objects_ocr.py index 87a827b3..a47f8520 100644 --- a/var/www/blueprints/objects_ocr.py +++ b/var/www/blueprints/objects_ocr.py @@ -108,6 +108,7 @@ def object_ocr(): meta = meta[0] languages = Language.get_translation_languages() return render_template("ShowOcr.html", meta=meta, + bootstrap_label=bootstrap_label, ail_tags=Tag.get_modal_add_tags(meta['id'], meta['type'], meta['subtype']), translation_languages=languages, translation_target=target) diff --git a/var/www/templates/correlation/show_correlation.html b/var/www/templates/correlation/show_correlation.html index 34241c9e..693a0ac0 100644 --- a/var/www/templates/correlation/show_correlation.html +++ b/var/www/templates/correlation/show_correlation.html @@ -733,9 +733,14 @@

Tags All Objects

desc = desc + "fa-times-circle\">DOWN" } desc = desc + "" - } else if (key!="tags" && key!="id" && key!="img" && key!="icon" && key!="link" && key!="type") { + } else if (key!=="tags" && key!=="id" && key!=="img" && key!=="svg_icon" && key!=="icon" && key!=="link" && key!=="type") { if (data[key]) { - desc = desc + "
" + sanitize_text(key) + "
" + sanitize_text(data[key]) + "
" + if ((key==="first_seen" || key==="last_seen") && data[key].length===8) { + let date = sanitize_text(data[key]) + desc = desc + "
" + sanitize_text(key) + "
" + date.slice(0, 4) + "-" + date.slice(4, 6) + "-" + date.slice(6, 8) + "
" + } else { + desc = desc + "
" + sanitize_text(key) + "
" + sanitize_text(data[key]) + "
" + } } } });