mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 02:28:23 +00:00
chg: [corellation graph] hide unsafe screenshots
This commit is contained in:
parent
6c6a3b48e2
commit
e0899e6e0d
3 changed files with 10 additions and 5 deletions
|
@ -86,8 +86,8 @@ class Screenshot(AbstractObject):
|
||||||
meta = {'id': self.id}
|
meta = {'id': self.id}
|
||||||
meta['img'] = get_screenshot_rel_path(self.id) ######### # TODO: Rename ME ??????
|
meta['img'] = get_screenshot_rel_path(self.id) ######### # TODO: Rename ME ??????
|
||||||
meta['tags'] = self.get_tags(r_list=True)
|
meta['tags'] = self.get_tags(r_list=True)
|
||||||
# TODO: ADD IN ABSTRACT CLASS
|
if 'tags_safe' in options:
|
||||||
#meta['is_tags_safe'] = Tag.is_tags_safe(metadata_dict['tags']) ################## # TODO: ADD IN ABSTRACT CLASS
|
meta['tags_safe'] = self.is_tags_safe(meta['tags'])
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
def get_screenshot_dir():
|
def get_screenshot_dir():
|
||||||
|
|
|
@ -157,7 +157,8 @@ def get_description():
|
||||||
return Response(json.dumps({"status": "error", "reason": "404 Not Found"}, indent=2, sort_keys=True), mimetype='application/json'), 404
|
return Response(json.dumps({"status": "error", "reason": "404 Not Found"}, indent=2, sort_keys=True), mimetype='application/json'), 404
|
||||||
# object exist
|
# object exist
|
||||||
else:
|
else:
|
||||||
res = ail_objects.get_object_meta(object_type, type_id, correlation_id, options={'tags'}, flask_context=True)
|
res = ail_objects.get_object_meta(object_type, type_id, correlation_id, options={'tags', 'tags_safe'},
|
||||||
|
flask_context=True)
|
||||||
if 'tags' in res:
|
if 'tags' in res:
|
||||||
res['tags'] = list(res['tags'])
|
res['tags'] = list(res['tags'])
|
||||||
return jsonify(res)
|
return jsonify(res)
|
||||||
|
|
|
@ -542,10 +542,14 @@ if (d.popover) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data["img"]) {
|
if (data["img"]) {
|
||||||
|
if (data["tags_safe"]) {
|
||||||
desc = desc + "<img src={{ url_for('objects_item.screenshot', filename="") }}" + data["img"] +" class=\"img-thumbnail\" />";
|
desc = desc + "<img src={{ url_for('objects_item.screenshot', filename="") }}" + data["img"] +" class=\"img-thumbnail\" />";
|
||||||
|
} else {
|
||||||
|
desc = desc + "<span class=\"my-2 fa-stack fa-4x\"><i class=\"fas fa-stack-1x fa-image\"></i><i class=\"fas fa-stack-2x fa-ban\" style=\"color:Red\"></i></span>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = desc + "</div>"
|
desc = desc + "</div></div>"
|
||||||
div.html(desc)
|
div.html(desc)
|
||||||
.style("left", (d3_pageX) + "px")
|
.style("left", (d3_pageX) + "px")
|
||||||
.style("top", (d3_pageY - 28) + "px");
|
.style("top", (d3_pageY - 28) + "px");
|
||||||
|
|
Loading…
Reference in a new issue