mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
chg: [correlation] add direct correlation stats
This commit is contained in:
parent
c008366f02
commit
ee951ca948
3 changed files with 21 additions and 1 deletions
|
@ -356,6 +356,10 @@ def obj_correlations_objs_add_tags(obj_type, subtype, obj_id, tags, filter_types
|
||||||
add_obj_tags(obj1_type, subtype1, id1, tags)
|
add_obj_tags(obj1_type, subtype1, id1, tags)
|
||||||
return objs
|
return objs
|
||||||
|
|
||||||
|
def get_obj_nb_correlations(obj_type, subtype, obj_id, filter_types=[]):
|
||||||
|
obj = get_object(obj_type, subtype, obj_id)
|
||||||
|
return obj.get_nb_correlations(filter_types=filter_types)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
################################################################################ TODO
|
################################################################################ TODO
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -125,7 +125,8 @@ def show_correlation():
|
||||||
"max_nodes": max_nodes, "mode": mode,
|
"max_nodes": max_nodes, "mode": mode,
|
||||||
"filter": filter_types, "filter_str": ",".join(filter_types),
|
"filter": filter_types, "filter_str": ",".join(filter_types),
|
||||||
"metadata": ail_objects.get_object_meta(obj_type, subtype, obj_id,
|
"metadata": ail_objects.get_object_meta(obj_type, subtype, obj_id,
|
||||||
options={'tags'}, flask_context=True)
|
options={'tags'}, flask_context=True),
|
||||||
|
"nb_correl": ail_objects.get_obj_nb_correlations(obj_type, subtype, obj_id)
|
||||||
}
|
}
|
||||||
if subtype:
|
if subtype:
|
||||||
dict_object["metadata"]['type_id'] = subtype
|
dict_object["metadata"]['type_id'] = subtype
|
||||||
|
|
|
@ -262,6 +262,21 @@
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item list-group-item-secondary"><i class="fas fa-project-diagram"></i> Direct Correlations</li>
|
||||||
|
<li class="list-group-item text-left">
|
||||||
|
{% for obj_type in dict_object['nb_correl'] %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
{{ obj_type }}
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<span class="badge badge-primary">{{ dict_object['nb_correl'][obj_type] }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue