Skip to content

Commit 88be6ec

Browse files
committed
chg: [trackers dashboard] change Trackers last matches table
1 parent f233aae commit 88be6ec

File tree

2 files changed

+37
-41
lines changed

2 files changed

+37
-41
lines changed

var/www/blueprints/hunters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def trackers_dashboard():
7272
user_org = current_user.get_org()
7373
user_id = current_user.get_user_id()
7474
trackers = Tracker.get_trackers_dashboard(user_org, user_id)
75+
for t in trackers:
76+
t['obj'] = ail_objects.get_obj_basic_meta(ail_objects.get_obj_from_global_id(t['obj']))
7577
stats = Tracker.get_trackers_stats(user_org, user_id)
7678
return render_template("trackers_dashboard.html", trackers=trackers, stats=stats, bootstrap_label=bootstrap_label)
7779

var/www/templates/hunter/trackers_dashboard.html

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">
1515

1616
<script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
17+
<script src="{{ url_for('static', filename='js/helper.js')}}"></script>
18+
<script src="{{ url_for('static', filename='js/popper.min.js')}}"></script>
1719
<script src="{{ url_for('static', filename='js/bootstrap4.min.js') }}"></script>
18-
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
19-
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js') }}"></script>
20-
<script src="{{ url_for('static', filename='js/d3.min.js') }}"></script>
21-
<script src="{{ url_for('static', filename='js/d3/sparklines.js') }}"></script>
20+
{# <script src="{{ url_for('static', filename='js/d3.min.js') }}"></script>#}
21+
{# <script src="{{ url_for('static', filename='js/d3/sparklines.js') }}"></script>#}
2222

2323
</head>
2424
<body>
@@ -93,47 +93,39 @@ <h5 class="card-title">
9393
<h5 class="card-title"><b>Trackers Last Matches</b></h5>
9494
</div>
9595
<div class="card-body">
96-
<table id="table_global_trackers" class="table table-striped table-borderless table-condensed">
97-
<tbody style="font-size: 15px;">
98-
{% for meta in trackers %}
96+
97+
<table class="table">
98+
<thead>
9999
<tr>
100-
<td>{{ meta['type'] }}</td>
101-
<td>
102-
<span>
103-
<a target="_blank" href="{{ url_for('hunters.show_tracker') }}?uuid={{ meta['uuid'] }}">
104-
{% if meta['tracked'] %}
105-
{% if meta['tracked']|length > 256 %}
106-
{{ meta['tracked'][0:256] }}...
107-
{% else %}
108-
{{ meta['tracked'] }}
109-
{% endif %}
110-
{% endif %}
111-
</a>
112-
{% if meta['description'] %}
113-
<div><i>{{ meta['description'] }}</i></div>
114-
{% endif %}
115-
</span>
116-
</td>
117-
<td>
118-
{% for tag in meta['tags'] %}
119-
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag }}">
120-
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
121-
</a>
122-
{% endfor %}
123-
</td>
124-
<td>
125-
{% if meta['first_seen'] %}
126-
{{ meta['first_seen'][0:4] }}/{{ meta['first_seen'][4:6] }}/{{ meta['first_seen'][6:8] }}
127-
{% endif %}
128-
</td>
129-
<td>
130-
{{ meta['timestamp'] }}
131-
</td>
132-
{# <td id="sparklines_{{ dict_uuid['uuid'] }}" style="text-align:center;"></td>#}
100+
<th><i class="fa-solid fa-crosshairs"></i></th>
101+
<th>tracker</th>
102+
<th class="text-center"><i class="fas fa-cube"></i></th>
103+
<th>Time</th>
133104
</tr>
134-
{% endfor %}
105+
</thead>
106+
<tbody id="tracked_objs">
107+
{% for tracker in trackers %}
108+
<tr>
109+
<td>{{ tracker['type'] }}</td>
110+
<td style="word-break: break-all;">
111+
<a href="{{ url_for('hunters.show_tracker') }}?uuid={{ tracker['uuid'] }}">{% if tracker['description'] %}{{ tracker['description'] }}{% else %}{{ tracker['tracked'] }}{% endif %}</a>
112+
</td>
113+
<td class="text-center">
114+
<a href="{{ tracker['obj']['link'] }}" onmouseenter="show_obj_tooltip(this, '{{ tracker['obj']['gid'] }}')" onmouseleave="hide_obj_tooltip(this)">
115+
<svg height="26" width="26" style="pointer-events:none;">
116+
<g class="nodes">
117+
<circle cx="13" cy="13" r="13" fill="{{ tracker['obj']['icon']['color'] }}"></circle>
118+
<text x="13" y="13" text-anchor="middle" dominant-baseline="central" class="{{ tracker['obj']['icon']['style'] }}" font-size="16px">{{ tracker['obj']['icon']['icon'] }}</text>
119+
</g>
120+
</svg>
121+
</a>
122+
</td>
123+
<td>{{ tracker['timestamp'] }}</td>
124+
</tr>
125+
{% endfor %}
135126
</tbody>
136127
</table>
128+
137129
</div>
138130
</div>
139131

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

159151
});
160152

153+
var url_obj_description = "{{ url_for('correlation.get_description') }}?object_id=";
154+
161155
function toggle_sidebar() {
162156
if ($('#nav_menu').is(':visible')) {
163157
$('#nav_menu').hide();

0 commit comments

Comments
 (0)