chg: [correlation graph] add date first/last seen separator + fix display of ocr object tags

pull/607/head
terrtia 2024-04-26 11:52:17 +02:00
parent 5503d8134a
commit 2b23d993df
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
3 changed files with 9 additions and 2 deletions

View File

@ -148,6 +148,7 @@ class Ocr(AbstractDaterangeObject):
if options is None: if options is None:
options = set() options = set()
meta = self._get_meta(options=options) meta = self._get_meta(options=options)
meta['tags'] = self.get_tags()
meta['content'] = self.get_content() meta['content'] = self.get_content()
# optional meta fields # optional meta fields

View File

@ -108,6 +108,7 @@ def object_ocr():
meta = meta[0] meta = meta[0]
languages = Language.get_translation_languages() languages = Language.get_translation_languages()
return render_template("ShowOcr.html", meta=meta, return render_template("ShowOcr.html", meta=meta,
bootstrap_label=bootstrap_label,
ail_tags=Tag.get_modal_add_tags(meta['id'], meta['type'], meta['subtype']), ail_tags=Tag.get_modal_add_tags(meta['id'], meta['type'], meta['subtype']),
translation_languages=languages, translation_target=target) translation_languages=languages, translation_target=target)

View File

@ -733,9 +733,14 @@ if (d.popover) {
desc = desc + "fa-times-circle\"></i>DOWN" desc = desc + "fa-times-circle\"></i>DOWN"
} }
desc = desc + "</div></dd>" desc = desc + "</div></dd>"
} 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]) { if (data[key]) {
if ((key==="first_seen" || key==="last_seen") && data[key].length===8) {
let date = sanitize_text(data[key])
desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + date.slice(0, 4) + "-" + date.slice(4, 6) + "-" + date.slice(6, 8) + "</dd>"
} else {
desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + sanitize_text(data[key]) + "</dd>" desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + sanitize_text(data[key]) + "</dd>"
}
} }
} }
}); });