mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
chg: [Domain UI] add total_nb_correlation
This commit is contained in:
parent
15bd1cc78f
commit
73afdfa227
3 changed files with 13 additions and 2 deletions
|
@ -237,6 +237,15 @@ def get_domain_all_correlation(domain, correlation_names=[], get_nb=False):
|
|||
|
||||
return domain_correl
|
||||
|
||||
def get_domain_total_nb_correlation(correlation_dict):
|
||||
total_correlation = 0
|
||||
if 'decoded' in correlation_dict:
|
||||
total_correlation += len(correlation_dict['decoded'])
|
||||
if 'cryptocurrency' in correlation_dict:
|
||||
total_correlation += correlation_dict['cryptocurrency'].get('nb', 0)
|
||||
if 'pgp' in correlation_dict:
|
||||
total_correlation += correlation_dict['pgp'].get('nb', 0)
|
||||
return total_correlation
|
||||
|
||||
# TODO: handle port
|
||||
def get_domain_history(domain, domain_type, port): # TODO: add date_range: from to + nb_elem
|
||||
|
|
|
@ -63,6 +63,7 @@ def showDomain():
|
|||
dict_domain['domain'] = domain_name
|
||||
if domain.is_domain_up():
|
||||
dict_domain = {**dict_domain, **domain.get_domain_correlation()}
|
||||
dict_domain['correlation_nb'] = Domain.get_domain_total_nb_correlation(dict_domain)
|
||||
dict_domain['origin_item'] = domain.get_domain_last_origin()
|
||||
dict_domain['tags'] = domain.get_domain_tags()
|
||||
dict_domain['tags_safe'] = Tag.is_tags_safe(dict_domain['tags'])
|
||||
|
|
|
@ -98,11 +98,12 @@
|
|||
Last Origin: <a class="badge" target="_blank" href="{{ url_for('showsavedpastes.showsavedpaste', paste=dict_domain['origin_item']) }}" />{{ dict_domain['origin_item'] }}</a>
|
||||
{%endif%}
|
||||
|
||||
{% if 'decoded' in dict_domain or 'pgp' in dict_domain or 'cryptocurrency' in dict_domain%}
|
||||
{% if dict_domain['correlation_nb'] > 0 %}
|
||||
<hr>
|
||||
<div class="mt-2">
|
||||
<a href="{{ url_for('correlation.show_correlation')}}?object_type=domain&correlation_id={{ dict_domain['domain'] }}&correlation_objects=domain" target="_blank" style="font-size: 15px">
|
||||
<button class="btn btn-info"><i class="fas fa-search"></i> Show Domain Correlations
|
||||
<button class="btn btn-info"><i class="fas fa-search"></i> Show Domain Correlations
|
||||
<div class="badge badge-warning">{{dict_domain['correlation_nb']}}</div>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue