mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 07:47:17 +00:00
chg: [correlation graph] add date first/last seen separator + fix display of ocr object tags
This commit is contained in:
parent
5503d8134a
commit
2b23d993df
3 changed files with 9 additions and 2 deletions
|
@ -148,6 +148,7 @@ class Ocr(AbstractDaterangeObject):
|
|||
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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -733,9 +733,14 @@ if (d.popover) {
|
|||
desc = desc + "fa-times-circle\"></i>DOWN"
|
||||
}
|
||||
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]) {
|
||||
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>"
|
||||
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>"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue