Skip to content

Commit

Permalink
chg: [tags search] search qrcode by tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Oct 3, 2024
1 parent 483d49f commit 6f2a59c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
8 changes: 8 additions & 0 deletions var/www/blueprints/tags_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,14 @@ def tags_search_ocrs():
dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s"}
return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged)

@tags_ui.route('/tag/search/qrcode')
@login_required
@login_read_only
def tags_search_qrcodes():
object_type = 'qrcode'
dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s"}
return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged)

@tags_ui.route('/tag/search/domain')
@login_required
@login_read_only
Expand Down
8 changes: 7 additions & 1 deletion var/www/templates/tags/menu_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ <h5 class="d-flex text-muted w-100" id="nav_tags_search">
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_ocrs') }}" id="nav_tags_search_message">
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_ocrs') }}" id="nav_tags_search_ocr">
<i class="fas fa-expand"></i>
Search Ocrs by Tags
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_qrcodes') }}" id="nav_tags_search_qrcode">
<i class="fas fa-qrcode"></i>
Search Qrcodes by Tags
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('tags_ui.tags_search_domains') }}" id="nav_tags_search_domain">
<i class="fab fa-html5"></i>
Expand Down
24 changes: 23 additions & 1 deletion var/www/templates/tags/search_obj_by_tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<th>Date</th>
<th style="max-width: 800px;">Item</th>
<th>Action</th>
{%elif dict_tagged["object_type"]=="qrcode"%}
<th>First seen</th>
<th>Last seen</th>
<th></th>
{%elif dict_tagged["object_type"]=="message"%}
<th>Date</th>
<th style="max-width: 800px;">Message</th>
Expand Down Expand Up @@ -145,7 +149,25 @@
</td>
</tr>
{% endfor %}

{%elif dict_tagged["object_type"]=="qrcode"%}
{% for dict_obj in dict_tagged["tagged_obj"] %}
<tr>
<td>{{ dict_obj['first_seen'] }}</td>
<td>{{ dict_obj['last_seen'] }}</td>
<td class="pb-0">
<a target="_blank" href="{{ url_for('correlation.show_correlation') }}?type={{dict_tagged['object_type']}}&id={{dict_obj['id']}}" class="text-secondary">
<div style="line-height:0.9;">{{ dict_obj['id'] }}</div>
</a>
<div class="mb-2">
{% for tag in dict_obj['tags'] %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type={{dict_tagged['object_type']}}&ltags={{ tag }}">
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
</a>
{% endfor %}
</div>
</td>
</tr>
{% endfor %}
{%elif dict_tagged["object_type"]=="message"%}
{% for dict_obj in dict_tagged["tagged_obj"] %}
<tr>
Expand Down

0 comments on commit 6f2a59c

Please sign in to comment.