2020-10-28 18:49:15 +01:00
|
|
|
{% macro taxonomy_table(tree_uuid, categories_info, add_category) %}
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table id="table" class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Machinetag</th>
|
|
|
|
{% if add_category %}
|
|
|
|
<th>Click to add category</th>
|
|
|
|
{% else %}
|
|
|
|
<th>Click to remove category</th>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-07-23 00:21:26 +02:00
|
|
|
{% if categories_info is mapping %}
|
2020-10-28 18:49:15 +01:00
|
|
|
{% for mt, val in categories_info.items() %}
|
|
|
|
<tr>
|
|
|
|
<td><a href="https://www.misp-project.org/taxonomies.html#_{{ val[0].name }}">{{ val[0].name }}</a></td>
|
|
|
|
<td>
|
|
|
|
{% if val|length == 3 %}
|
|
|
|
{% if val[2].description %}
|
|
|
|
{{ val[2].description }}
|
|
|
|
{% elif val[2].expanded %}
|
|
|
|
{{ val[2].expanded }}
|
|
|
|
{%endif%}
|
|
|
|
{% elif val[1].description %}
|
|
|
|
{{ val[1].description }}
|
|
|
|
{% else %}
|
|
|
|
{{ val[1].predicate }}
|
|
|
|
{%endif%}
|
|
|
|
</td>
|
|
|
|
<td>{{ mt }}</td>
|
|
|
|
<td>
|
2022-03-18 10:48:09 +01:00
|
|
|
<button type="button" class="btn btn-primary {% if add_category %}categorize_capture{% else %}uncategorize_capture{% endif %}" value="{{ mt }}">
|
2020-10-28 18:49:15 +01:00
|
|
|
{% if add_category %}
|
|
|
|
Categorize capture.
|
|
|
|
{% else %}
|
|
|
|
Uncategorize capture.
|
|
|
|
{% endif %}
|
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2024-07-23 00:21:26 +02:00
|
|
|
{% else %}
|
|
|
|
{% for mt in categories_info %}
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td>
|
|
|
|
</td>
|
|
|
|
<td>{{ mt }}</td>
|
|
|
|
<td>
|
|
|
|
<button type="button" class="btn btn-primary {% if add_category %}categorize_capture{% else %}uncategorize_capture{% endif %}" value="{{ mt }}">
|
|
|
|
{% if add_category %}
|
|
|
|
Categorize capture.
|
|
|
|
{% else %}
|
|
|
|
Uncategorize capture.
|
|
|
|
{% endif %}
|
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-10-28 18:49:15 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2024-09-04 16:30:33 +02:00
|
|
|
<script nonce="{{ csp_nonce() }}">
|
2020-10-28 18:49:15 +01:00
|
|
|
$('.categorize_capture').on('click',function(e){
|
|
|
|
var button = $(this);
|
|
|
|
$.get("{{ url_for('categorize_capture', tree_uuid=tree_uuid) }}" + button.val())
|
2024-06-24 11:18:47 +02:00
|
|
|
$('#categoriesModal .modal-body').load("{{ url_for('categories_capture', tree_uuid=tree_uuid) }}")
|
2020-10-28 18:49:15 +01:00
|
|
|
});
|
|
|
|
$('.uncategorize_capture').on('click',function(e){
|
|
|
|
var button = $(this);
|
|
|
|
$.get("{{ url_for('uncategorize_capture', tree_uuid=tree_uuid) }}" + button.val())
|
2024-06-24 11:18:47 +02:00
|
|
|
$('#categoriesModal .modal-body').load("{{ url_for('categories_capture', tree_uuid=tree_uuid) }}")
|
2020-10-28 18:49:15 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
2020-08-25 18:00:16 +02:00
|
|
|
{% macro known_content_details(details) %}
|
2020-07-12 01:56:29 +02:00
|
|
|
<div>
|
|
|
|
{% if details is string %}
|
|
|
|
<b>{{ details }} </b>
|
|
|
|
{% else %}
|
|
|
|
This file is known as part of <b>{{ details[0] }}</b>
|
|
|
|
version <b>{{ details[1] }}</b>: <b>{{ details[2] }}</b>.
|
|
|
|
{% if details[3] > 1%}
|
|
|
|
It is also present in <b>{{ details[3] -1 }}</b> other libraries.
|
|
|
|
{%endif%}
|
|
|
|
{%endif%}
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2024-10-07 13:15:15 +02:00
|
|
|
{% macro context_form(tree_uuid, urlnode_uuid, hash, callback_str) %}
|
2022-03-18 10:48:09 +01:00
|
|
|
<button class="btn btn-primary collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#context_response_{{ urlnode_uuid }}" aria-expanded="false" aria-controls="collapseContextForm">
|
2020-09-03 16:31:45 +02:00
|
|
|
<span class="if-collapsed">Add context</span>
|
|
|
|
<span class="if-not-collapsed">Hide context form</span>
|
|
|
|
</button>
|
|
|
|
<div class="collapse" id="context_response_{{ urlnode_uuid }}">
|
|
|
|
<div class="card card-body">
|
2020-10-09 18:05:04 +02:00
|
|
|
<form role="form" action="{{ url_for('add_context', tree_uuid=tree_uuid, node_uuid=urlnode_uuid) }}" method=post enctype=multipart/form-data>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" type="checkbox" name="legitimate" id="legitimate">
|
|
|
|
<label for="legitimate" class="form-check-label">Legitimate</label>
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<label for="legitimate_domain" class="form-label">Domain serving the file when considered legitimate:</label>
|
|
|
|
<input type="text" class="form-control" name="legitimate_domain" id="legitimate_domain" placeholder="Domain name">
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<label for="legitimate_description" class="form-label">Other context for this content (library name, owner, ...):</label>
|
|
|
|
<input type="text" class="form-control" name="legitimate_description" id="legitimate_description" placeholder="Description">
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" type="checkbox" name="malicious"></input>
|
|
|
|
<label for="malicious" class="form-check-label">Malicious</label>
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<label for="malicious_type" class="form-label">Type of malicious content (phishing, malware, ...):</label>
|
|
|
|
<input type="text" class="form-control" name="malicious_type" id="malicious_type" placeholder="Type of malicious content">
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
2022-01-14 15:58:06 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<label for="malicious_target" class="form-label">Legitimate target of the malicious content (expecially for phishing):</label>
|
|
|
|
<input type="text" class="form-control" name="malicious_target" id="malicious_target" placeholder="Target">
|
|
|
|
</div>
|
2020-09-03 16:31:45 +02:00
|
|
|
</div>
|
|
|
|
<input type="hidden" id="hash_to_contextualize" name="hash_to_contextualize" value="{{ hash }}">
|
|
|
|
<input type="hidden" id="callback_str" name="callback_str" value="{{ callback_str }}">
|
2022-03-18 10:48:09 +01:00
|
|
|
<button type="submit" class="btn btn-primary" id="btn-looking">Submit context</button>
|
2020-09-03 16:31:45 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2021-02-09 22:01:20 +01:00
|
|
|
{% macro get_ressource_button(capture_uuid, urlnode_uuid, hash, text, can_preview=False) %}
|
2020-09-03 14:39:38 +02:00
|
|
|
<form method="post" action="{{ url_for('get_ressource', tree_uuid=capture_uuid, node_uuid=urlnode_uuid) }}">
|
2022-03-18 10:48:09 +01:00
|
|
|
<button class="btn btn-primary" name="ressource_hash" value="{{ hash }}"
|
2021-02-09 22:01:20 +01:00
|
|
|
{% if can_preview %}
|
2022-01-14 15:58:06 +01:00
|
|
|
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true"
|
2021-05-12 02:14:28 +02:00
|
|
|
title='<img class="ressource_preview" src="{{ url_for('get_ressource_preview', tree_uuid=capture_uuid, node_uuid=urlnode_uuid, h_ressource=hash) }}"/>'
|
2021-02-09 22:01:20 +01:00
|
|
|
{% endif %}
|
|
|
|
>{{ text }}</button>
|
2020-09-03 14:39:38 +02:00
|
|
|
</form>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2020-08-27 12:57:10 +02:00
|
|
|
{% macro ressource_legitimacy_details(details, ressource_size) %}
|
|
|
|
{% if details and details[0] == False %}
|
|
|
|
<img src="/static/bomb.svg" title="Known malicious content in the response." width="21" height="21"/>
|
|
|
|
{%endif%}
|
2022-08-05 16:28:39 +02:00
|
|
|
<b>Body size</b> (in the HTTP response): {{ sizeof_fmt(ressource_size) }}
|
2020-08-27 12:57:10 +02:00
|
|
|
{% if details %}
|
|
|
|
{% if details[0] %}
|
2020-09-01 17:33:36 +02:00
|
|
|
- This file is known <b>legitimate</b> on the following domains: {{ ', '.join(details[1]) }}.
|
2020-08-27 12:57:10 +02:00
|
|
|
{% elif details[0] == False %}
|
2020-09-01 17:33:36 +02:00
|
|
|
</br>
|
2020-09-08 19:18:55 +02:00
|
|
|
<p>
|
2020-09-01 17:33:36 +02:00
|
|
|
The response sould be considered as
|
|
|
|
{% if details[1] is mapping and details[1].get('tag') %}
|
|
|
|
<b>{{ ', '.join(details[1]['tag']) }}</b>
|
|
|
|
{% else %}
|
|
|
|
<b>phishing</b>
|
|
|
|
{%endif%}
|
|
|
|
{% if details[1] is mapping and details[1].get('target') %}
|
2020-09-14 14:12:22 +02:00
|
|
|
and is targeting <b>the following domain(s)</b>: {{ ', '.join(details[1]['target']) }}
|
2020-08-27 12:57:10 +02:00
|
|
|
{% else %}
|
2020-09-01 17:33:36 +02:00
|
|
|
unless it is served by <b>the following domain(s)</b>: {{ ', '.join(details[1]) }}
|
2020-08-27 12:57:10 +02:00
|
|
|
{%endif%}
|
2020-09-08 19:18:55 +02:00
|
|
|
</p>
|
2020-08-27 12:57:10 +02:00
|
|
|
{%endif%}
|
|
|
|
{%endif%}
|
|
|
|
{% endmacro %}
|
|
|
|
|
2020-07-12 01:56:29 +02:00
|
|
|
{% macro indexed_hash(details, identifier_for_toggle) %}
|
2020-09-01 17:33:36 +02:00
|
|
|
{% set total_captures = details[0] %}
|
|
|
|
{% set other_captures = details[1] %}
|
2020-07-12 01:56:29 +02:00
|
|
|
{# Only show details if the hits are in an other capture #}
|
2024-10-08 23:10:46 +02:00
|
|
|
{% if total_captures > 1 %}
|
2020-07-12 01:56:29 +02:00
|
|
|
<p>
|
2024-10-07 13:15:15 +02:00
|
|
|
The same file was seen in <b>{{ total_captures - 1 }}</b> other captures.
|
2021-05-12 02:14:28 +02:00
|
|
|
</br>
|
2024-02-27 15:29:35 +01:00
|
|
|
<button class="btn btn-primary collapsed" type="button" data-bs-toggle="collapse"
|
|
|
|
data-bs-target="#captureslist_{{ identifier_for_toggle }}"
|
|
|
|
aria-expanded="false" aria-controls="collapseExample">
|
2024-10-07 13:15:15 +02:00
|
|
|
<span class="if-collapsed">Show other recent captures</span>
|
|
|
|
<span class="if-not-collapsed">Hide other recent captures</span>
|
2020-07-12 01:56:29 +02:00
|
|
|
</button>
|
|
|
|
</p>
|
|
|
|
{# Lists of other captures loading the same content... #}
|
|
|
|
<div class="collapse" id="captureslist_{{ identifier_for_toggle }}">
|
|
|
|
<div class="card card-body">
|
2024-10-08 23:10:46 +02:00
|
|
|
Note that only the most recent cached captures are displayed here, click on the link below to see more.
|
2020-09-01 17:33:36 +02:00
|
|
|
{% if other_captures['different_url']|length > 0 %}
|
2020-07-12 01:56:29 +02:00
|
|
|
{# ... on other URLs #}
|
|
|
|
<div>
|
|
|
|
<p>The following captures get the same file from a <b>different URL</b></p>
|
2024-02-27 15:29:35 +01:00
|
|
|
{{ other_captures_table(other_captures['different_url'], 20, identifier_for_toggle + '_same') }}
|
2020-07-12 01:56:29 +02:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</br>
|
2020-09-01 17:33:36 +02:00
|
|
|
{% if other_captures['same_url']|length > 0 %}
|
2020-07-12 01:56:29 +02:00
|
|
|
{# ... on the same URL #}
|
|
|
|
<div>
|
|
|
|
<p>The following captures get the same file from the <b>same URL</b></p>
|
2024-02-27 15:29:35 +01:00
|
|
|
{{ other_captures_table(other_captures['same_url'], 20, identifier_for_toggle + '_different') }}
|
2020-07-12 01:56:29 +02:00
|
|
|
</div>
|
2020-07-16 01:08:39 +02:00
|
|
|
{% endif %}
|
2020-07-12 01:56:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2020-07-12 14:59:01 +02:00
|
|
|
|
2024-02-27 15:29:35 +01:00
|
|
|
{% macro other_captures_table(entries, max_entries, identifier) %}
|
2024-09-04 16:30:33 +02:00
|
|
|
<script type="text/javascript" nonce="{{ csp_nonce() }}">
|
2024-02-27 15:29:35 +01:00
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
2024-10-09 22:46:16 +02:00
|
|
|
new DataTable('#table_other_captures_{{identifier}}', {
|
2024-02-27 15:29:35 +01:00
|
|
|
"order": [[ 1, "desc" ]],
|
|
|
|
"paging": false,
|
|
|
|
"info": false,
|
|
|
|
"columns": [
|
|
|
|
{ "orderable": false},
|
|
|
|
{ "orderable": false},
|
|
|
|
{ "orderable": false}
|
|
|
|
],
|
|
|
|
"columnDefs": [{
|
|
|
|
"targets": 1,
|
|
|
|
"render": (data) => {
|
|
|
|
const date = new Date(data);
|
|
|
|
return date.getFullYear() + '-' + (date.getMonth() + 1).toString().padStart(2, "0") + '-' + date.getDate().toString().padStart(2, "0") + ' ' + date.toTimeString();
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
} );
|
|
|
|
});
|
|
|
|
</script>
|
2024-09-04 16:30:33 +02:00
|
|
|
|
2024-02-27 15:29:35 +01:00
|
|
|
<div>
|
2024-10-09 22:46:16 +02:00
|
|
|
<table id="table_other_captures_{{identifier}}" class="table table-striped" style="width:100%">
|
2020-08-10 15:42:26 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Title</th>
|
|
|
|
<th>Timestamp</th>
|
|
|
|
<th>Domain</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-28 16:14:47 +02:00
|
|
|
{% for capture_uuid, urlnode_uuid, title, timestamp, hostname in entries[:max_entries] %}
|
2020-08-10 15:42:26 +02:00
|
|
|
<tr>
|
|
|
|
<td>
|
2024-09-04 16:30:33 +02:00
|
|
|
<button type="button" class="btn btn-link openNewTab" data-capture="{{capture_uuid}}" data-hostnode="{{urlnode_uuid}}">{{ title }}</button>
|
2020-08-10 15:42:26 +02:00
|
|
|
</td>
|
|
|
|
<td>{{ timestamp }}</td>
|
|
|
|
<td>{{ hostname }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2020-07-12 14:59:01 +02:00
|
|
|
{% macro indexed_cookies(header_text, button_text, cookies) %}
|
|
|
|
{% if cookies %}
|
|
|
|
<div>{{ header_text }}</div>
|
|
|
|
<ul>
|
|
|
|
{% for cookie, details in cookies.items() %}
|
|
|
|
{% set cookie_name_value = cookie.split('=', 1) %}
|
|
|
|
{% for detail in details %}
|
|
|
|
{% if detail|length == 1 %}
|
|
|
|
<li>
|
|
|
|
{{ detail[0] }}: <a href="{{ url_for('cookies_name_detail', cookie_name=cookie_name_value[0]) }}">
|
2020-07-17 18:39:50 +02:00
|
|
|
{{ cookie_name_value[0] }}</a>={{ shorten_string(cookie_name_value[1], 200) }}
|
2020-07-12 14:59:01 +02:00
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<li>
|
|
|
|
{{ detail[0] }}: <a href="{{ url_for('cookies_name_detail', cookie_name=cookie_name_value[0]) }}">
|
2020-07-17 18:39:50 +02:00
|
|
|
{{ cookie_name_value[0] }}</a>={{ shorten_string(cookie_name_value[1], 200) }} -
|
2020-07-23 17:47:12 +02:00
|
|
|
</br>
|
|
|
|
{{ button_text }}
|
2024-09-04 16:30:33 +02:00
|
|
|
<button type="button" class="btn btn-primary locateInTree" data-hostnode="{{ detail[1] }}">Locate</button>
|
2020-07-12 14:59:01 +02:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2020-07-15 13:51:45 +02:00
|
|
|
|
2022-08-01 17:51:43 +02:00
|
|
|
{% macro popup_icons_request(urlnode, tree_uuid) %}
|
2020-07-15 13:51:45 +02:00
|
|
|
<div>
|
2022-08-01 17:51:43 +02:00
|
|
|
{% if urlnode.request_cookie %}
|
|
|
|
{% set icon_info = get_icon("request_cookie") %}
|
2021-01-01 22:47:34 +01:00
|
|
|
<a href="{{ url_for('urlnode_request_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}"
|
|
|
|
title="Download all the cookies in the request to the server">
|
2022-08-01 17:51:43 +02:00
|
|
|
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}"
|
|
|
|
width="21" height="21"/>
|
2020-07-15 13:51:45 +02:00
|
|
|
</a>
|
2022-08-01 17:51:43 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2023-04-26 15:40:36 +02:00
|
|
|
|
|
|
|
{% macro pandora_submit(node_uuid, ressource_hash) %}
|
|
|
|
<div class="col-sm-8">
|
2024-09-04 16:30:33 +02:00
|
|
|
<button type="button" class="btn btn-primary btn-sm submitPandoraButton"
|
|
|
|
title="open a new tab with the pandora report"
|
|
|
|
data-hostnode="{{ node_uuid }}"
|
|
|
|
data-hash="{{ ressource_hash }}">
|
|
|
|
Submit to Pandora
|
|
|
|
</button>
|
2023-04-26 15:40:36 +02:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
2022-08-01 17:51:43 +02:00
|
|
|
{% macro popup_icons_response(urlnode, tree_uuid) %}
|
|
|
|
<div>
|
|
|
|
{% if urlnode.response_cookie %}
|
|
|
|
{% set icon_info = get_icon("response_cookie") %}
|
2021-01-01 22:47:34 +01:00
|
|
|
<a href="{{ url_for('urlnode_response_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}"
|
|
|
|
title="Download all the cookies in the response from the server">
|
|
|
|
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}"
|
|
|
|
width="21" height="21"/>
|
2020-07-15 13:51:45 +02:00
|
|
|
</a>
|
2022-08-01 17:51:43 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if urlnode.generic_type in ["js", "exe", "css", "font", "html", "json", "image", "video",
|
|
|
|
"unknown_mimetype", "text", "unset_mimetype", "octet-stream",
|
|
|
|
"livestream"] %}
|
|
|
|
{% set icon_info = get_icon(urlnode.generic_type) %}
|
|
|
|
<a href="{{ url_for('get_ressource', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}">
|
|
|
|
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}"
|
|
|
|
width="21" height="21"
|
|
|
|
{% if urlnode.generic_type == "image" %}
|
|
|
|
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true"
|
|
|
|
title='<img class="ressource_preview" src="{{ url_for('get_ressource_preview', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}"/> </br>Click to download.'
|
|
|
|
{% else %}
|
|
|
|
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true"
|
|
|
|
title="{{icon_info['tooltip']}} <br/>Click to download."
|
|
|
|
{% endif %}
|
|
|
|
/>
|
|
|
|
</a>
|
2020-07-15 13:51:45 +02:00
|
|
|
{%endif%}
|
|
|
|
</div>
|
2020-12-07 13:25:47 +01:00
|
|
|
|
|
|
|
<div>
|
2022-08-01 17:51:43 +02:00
|
|
|
{% if urlnode["redirect"] %}
|
|
|
|
{% set icon_info = get_icon('redirect') %}
|
2020-12-07 13:25:47 +01:00
|
|
|
{% for child in urlnode.children if child.name == urlnode.redirect_url %}
|
|
|
|
<div title='{{ urlnode.redirect_url }}'>
|
|
|
|
<b>Redirect to</b>: {{ shorten_string(urlnode.redirect_url, 50) }}
|
2024-09-04 16:30:33 +02:00
|
|
|
<button type="button" class="btn btn-link locateInTree" data-hostnode="{{ child.hostnode_uuid }}" title="See the node the URL redirects to.">
|
2022-08-01 17:51:43 +02:00
|
|
|
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}" width="21" height="21"/>
|
2024-09-04 16:30:33 +02:00
|
|
|
</button>
|
2020-12-07 13:25:47 +01:00
|
|
|
</div>
|
|
|
|
{% else %}
|
2022-08-01 17:51:43 +02:00
|
|
|
<img src="{{ url_for('static', filename=icon_info['icon']) }}"
|
|
|
|
alt="{{ icon_info['tooltip'] }}" title="{{ icon_info['tooltip'] }}"
|
2021-01-01 22:47:34 +01:00
|
|
|
width="21" height="21"/>
|
2020-12-07 13:25:47 +01:00
|
|
|
{% endfor %}
|
|
|
|
{%endif%}
|
|
|
|
</div>
|
2020-07-15 13:51:45 +02:00
|
|
|
{% endmacro %}
|
2020-07-15 18:04:34 +02:00
|
|
|
|
2020-12-10 11:56:44 +01:00
|
|
|
{% macro shorten_string(string, cut_length, with_title=False) %}
|
|
|
|
{% if with_title %}
|
|
|
|
<div title={{string}}>
|
|
|
|
{%endif%}
|
|
|
|
|
2020-07-15 18:04:34 +02:00
|
|
|
{% if string|length > cut_length %}
|
|
|
|
{{ string[:cut_length] }} [...]
|
|
|
|
{% else %}
|
|
|
|
{{ string }}
|
|
|
|
{%endif%}
|
2020-12-10 11:56:44 +01:00
|
|
|
|
|
|
|
{% if with_title %}
|
|
|
|
</div>
|
|
|
|
{%endif%}
|
|
|
|
|
2020-07-15 18:04:34 +02:00
|
|
|
{% endmacro %}
|