Skip to content

Commit 6f2a59c

Browse files
committed
chg: [tags search] search qrcode by tags
1 parent 483d49f commit 6f2a59c

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

var/www/blueprints/tags_ui.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ def tags_search_ocrs():
309309
dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s"}
310310
return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged)
311311

312+
@tags_ui.route('/tag/search/qrcode')
313+
@login_required
314+
@login_read_only
315+
def tags_search_qrcodes():
316+
object_type = 'qrcode'
317+
dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s"}
318+
return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged)
319+
312320
@tags_ui.route('/tag/search/domain')
313321
@login_required
314322
@login_read_only

var/www/templates/tags/menu_sidebar.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ <h5 class="d-flex text-muted w-100" id="nav_tags_search">
2929
</a>
3030
</li>
3131
<li class="nav-item">
32-
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_ocrs') }}" id="nav_tags_search_message">
32+
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_ocrs') }}" id="nav_tags_search_ocr">
3333
<i class="fas fa-expand"></i>
3434
Search Ocrs by Tags
3535
</a>
3636
</li>
37+
<li class="nav-item">
38+
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_qrcodes') }}" id="nav_tags_search_qrcode">
39+
<i class="fas fa-qrcode"></i>
40+
Search Qrcodes by Tags
41+
</a>
42+
</li>
3743
<li class="nav-item">
3844
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_domains') }}" id="nav_tags_search_domain">
3945
<i class="fab fa-html5"></i>

var/www/templates/tags/search_obj_by_tags.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
<th>Date</th>
6868
<th style="max-width: 800px;">Item</th>
6969
<th>Action</th>
70+
{%elif dict_tagged["object_type"]=="qrcode"%}
71+
<th>First seen</th>
72+
<th>Last seen</th>
73+
<th></th>
7074
{%elif dict_tagged["object_type"]=="message"%}
7175
<th>Date</th>
7276
<th style="max-width: 800px;">Message</th>
@@ -145,7 +149,25 @@
145149
</td>
146150
</tr>
147151
{% endfor %}
148-
152+
{%elif dict_tagged["object_type"]=="qrcode"%}
153+
{% for dict_obj in dict_tagged["tagged_obj"] %}
154+
<tr>
155+
<td>{{ dict_obj['first_seen'] }}</td>
156+
<td>{{ dict_obj['last_seen'] }}</td>
157+
<td class="pb-0">
158+
<a target="_blank" href="{{ url_for('correlation.show_correlation') }}?type={{dict_tagged['object_type']}}&id={{dict_obj['id']}}" class="text-secondary">
159+
<div style="line-height:0.9;">{{ dict_obj['id'] }}</div>
160+
</a>
161+
<div class="mb-2">
162+
{% for tag in dict_obj['tags'] %}
163+
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type={{dict_tagged['object_type']}}&ltags={{ tag }}">
164+
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
165+
</a>
166+
{% endfor %}
167+
</div>
168+
</td>
169+
</tr>
170+
{% endfor %}
149171
{%elif dict_tagged["object_type"]=="message"%}
150172
{% for dict_obj in dict_tagged["tagged_obj"] %}
151173
<tr>

0 commit comments

Comments
 (0)