fix: [tracker] UI for other than typosquat

This commit is contained in:
David Cruciani 2022-05-16 11:16:25 +02:00
parent 33ba18b189
commit a1fe7d01e4
2 changed files with 46 additions and 34 deletions

View file

@ -67,40 +67,44 @@
<li class="list-group-item py-0"> <li class="list-group-item py-0">
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-10">
<table class="table" style="word-wrap: break-word;"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Type</th> <th>Type</th>
<th>Tracker</th> <th>Tracker</th>
<th>Date added</th> <th>Date added</th>
<th>Access Level</th> <th>Access Level</th>
<th>Created by</th> <th>Created by</th>
<th>First seen</th> <th>First seen</th>
<th>Last seen</th> <th>Last seen</th>
{% if tracker_metadata['webhook'] %} {% if tracker_metadata['webhook'] %}
<th>Webhook</th> <th>Webhook</th>
{% endif %} {% endif %}
<th>Tags <span class="btn-link btn-interaction mouse_pointer" <th>Tags <span class="btn-link btn-interaction mouse_pointer"
title="Edit Tags List" onclick="edit_tags();"><i title="Edit Tags List" onclick="edit_tags();"><i
class="fas fa-pencil-alt" style="color:Red;"></i></span></th> class="fas fa-pencil-alt" style="color:Red;"></i></span></th>
<th>Email <span class="btn-link btn-interaction mouse_pointer" <th>Email <span class="btn-link btn-interaction mouse_pointer"
title="Edit Email List" onclick="edit_mails();"><i title="Edit Email List" onclick="edit_mails();"><i
class="fas fa-pencil-alt" style="color:Red;"></i></span></th> class="fas fa-pencil-alt" style="color:Red;"></i></span></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{ tracker_metadata['type'] }}</td> <td>{{ tracker_metadata['type'] }}</td>
<td style="word-break: break-word;"> {% if tracker_metadata['type'] == 'typosquat' %}
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample"> <td style="word-break: break-word;">
{{ tracker_metadata['tracker'].split(",")[0] }} <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
</a> {{ tracker_metadata['tracker'].split(",")[0] }}
<div class="collapse" id="collapseExample"> </a>
<div class="card card-body"> <div class="collapse" id="collapseExample">
{{ tracker_metadata['tracker'] }} <div class="card card-body">
{{ tracker_metadata['tracker'] }}
</div>
</div> </div>
</div> </td>
</td> {% else %}
<td>{{ tracker_metadata['tracker'] }}</td>
{% endif %}
<td>{{ tracker_metadata['date'][0:4] }}/{{ tracker_metadata['date'][4:6] }}/{{ tracker_metadata['date'][6:8] }}</td> <td>{{ tracker_metadata['date'][0:4] }}/{{ tracker_metadata['date'][4:6] }}/{{ tracker_metadata['date'][6:8] }}</td>
<td> <td>
{% if tracker_metadata['level'] == 0 %} {% if tracker_metadata['level'] == 0 %}

View file

@ -70,10 +70,14 @@
<span> <span>
<a target="_blank" href="{{ url_for('hunter.show_tracker') }}?uuid={{ dict_uuid['uuid'] }}"> <a target="_blank" href="{{ url_for('hunter.show_tracker') }}?uuid={{ dict_uuid['uuid'] }}">
{% if dict_uuid['term'] %} {% if dict_uuid['term'] %}
{% if dict_uuid['term']|length > 100 %} {% if dict_uuid['term']|length > 2000 %}
{{ dict_uuid['term'][0:100] }}... {{ dict_uuid['term'][0:50] }}...
{% else %} {% else %}
{{ dict_uuid['term'] }} {% if dict_uuid['term']|length > 100 %}
{{ dict_uuid['term'][0:100] }}...
{% else %}
{{ dict_uuid['term'] }}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</a> </a>
@ -135,10 +139,14 @@
<span> <span>
<a target="_blank" href="{{ url_for('hunter.show_tracker') }}?uuid={{ dict_uuid['uuid'] }}"> <a target="_blank" href="{{ url_for('hunter.show_tracker') }}?uuid={{ dict_uuid['uuid'] }}">
{% if dict_uuid['term'] %} {% if dict_uuid['term'] %}
{% if dict_uuid['term']|length > 100 %} {% if dict_uuid['term']|length > 2000 %}
{{ dict_uuid['term'][0:100] }}... {{ dict_uuid['term'][0:50] }}...
{% else %} {% else %}
{{ dict_uuid['term'] }} {% if dict_uuid['term']|length > 100 %}
{{ dict_uuid['term'][0:100] }}...
{% else %}
{{ dict_uuid['term'] }}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</a> </a>