Skip to content

Commit

Permalink
chg: [trackers dashboard] change Trackers last matches table
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Feb 7, 2025
1 parent f233aae commit 88be6ec
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 41 deletions.
2 changes: 2 additions & 0 deletions var/www/blueprints/hunters.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def trackers_dashboard():
user_org = current_user.get_org()
user_id = current_user.get_user_id()
trackers = Tracker.get_trackers_dashboard(user_org, user_id)
for t in trackers:
t['obj'] = ail_objects.get_obj_basic_meta(ail_objects.get_obj_from_global_id(t['obj']))
stats = Tracker.get_trackers_stats(user_org, user_id)
return render_template("trackers_dashboard.html", trackers=trackers, stats=stats, bootstrap_label=bootstrap_label)

Expand Down
76 changes: 35 additions & 41 deletions var/www/templates/hunter/trackers_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">

<script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/helper.js')}}"></script>
<script src="{{ url_for('static', filename='js/popper.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap4.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/d3.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/d3/sparklines.js') }}"></script>
{# <script src="{{ url_for('static', filename='js/d3.min.js') }}"></script>#}
{# <script src="{{ url_for('static', filename='js/d3/sparklines.js') }}"></script>#}

</head>
<body>
Expand Down Expand Up @@ -93,47 +93,39 @@ <h5 class="card-title">
<h5 class="card-title"><b>Trackers Last Matches</b></h5>
</div>
<div class="card-body">
<table id="table_global_trackers" class="table table-striped table-borderless table-condensed">
<tbody style="font-size: 15px;">
{% for meta in trackers %}

<table class="table">
<thead>
<tr>
<td>{{ meta['type'] }}</td>
<td>
<span>
<a target="_blank" href="{{ url_for('hunters.show_tracker') }}?uuid={{ meta['uuid'] }}">
{% if meta['tracked'] %}
{% if meta['tracked']|length > 256 %}
{{ meta['tracked'][0:256] }}...
{% else %}
{{ meta['tracked'] }}
{% endif %}
{% endif %}
</a>
{% if meta['description'] %}
<div><i>{{ meta['description'] }}</i></div>
{% endif %}
</span>
</td>
<td>
{% for tag in meta['tags'] %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag }}">
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
</a>
{% endfor %}
</td>
<td>
{% if meta['first_seen'] %}
{{ meta['first_seen'][0:4] }}/{{ meta['first_seen'][4:6] }}/{{ meta['first_seen'][6:8] }}
{% endif %}
</td>
<td>
{{ meta['timestamp'] }}
</td>
{# <td id="sparklines_{{ dict_uuid['uuid'] }}" style="text-align:center;"></td>#}
<th><i class="fa-solid fa-crosshairs"></i></th>
<th>tracker</th>
<th class="text-center"><i class="fas fa-cube"></i></th>
<th>Time</th>
</tr>
{% endfor %}
</thead>
<tbody id="tracked_objs">
{% for tracker in trackers %}
<tr>
<td>{{ tracker['type'] }}</td>
<td style="word-break: break-all;">
<a href="{{ url_for('hunters.show_tracker') }}?uuid={{ tracker['uuid'] }}">{% if tracker['description'] %}{{ tracker['description'] }}{% else %}{{ tracker['tracked'] }}{% endif %}</a>
</td>
<td class="text-center">
<a href="{{ tracker['obj']['link'] }}" onmouseenter="show_obj_tooltip(this, '{{ tracker['obj']['gid'] }}')" onmouseleave="hide_obj_tooltip(this)">
<svg height="26" width="26" style="pointer-events:none;">
<g class="nodes">
<circle cx="13" cy="13" r="13" fill="{{ tracker['obj']['icon']['color'] }}"></circle>
<text x="13" y="13" text-anchor="middle" dominant-baseline="central" class="{{ tracker['obj']['icon']['style'] }}" font-size="16px">{{ tracker['obj']['icon']['icon'] }}</text>
</g>
</svg>
</a>
</td>
<td>{{ tracker['timestamp'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
</div>

Expand All @@ -158,6 +150,8 @@ <h5 class="card-title"><b>Trackers Last Matches</b></h5>

});

var url_obj_description = "{{ url_for('correlation.get_description') }}?object_id=";

function toggle_sidebar() {
if ($('#nav_menu').is(':visible')) {
$('#nav_menu').hide();
Expand Down

0 comments on commit 88be6ec

Please sign in to comment.