fix: render image preview in ressources, bugfixes

pull/898/head
Raphaël Vinot 2024-03-14 17:27:39 +01:00
parent 66cee1c851
commit 26f0919772
3 changed files with 17 additions and 19 deletions

View File

@ -1,7 +1,7 @@
{% from "macros.html" import shorten_string %} {% from "macros.html" import shorten_string %}
<script type="text/javascript"> <script type="text/javascript">
new DataTable('#identifierDetailsTable_{{favicon_sha512}}', { new DataTable('#identifierDetailsTable', {
order: [[ 0, "desc" ]], order: [[ 0, "desc" ]],
columnDefs: [{ width: '30%', columnDefs: [{ width: '30%',
targets: 0, targets: 0,

View File

@ -1,10 +1,17 @@
{% from "macros.html" import popup_icons_response %}
<script type="text/javascript"> <script type="text/javascript">
new DataTable('#bodyHashesTable', { var table = new DataTable('#bodyHashesTable', {
order: [[ 0, "desc" ]], order: [[ 0, "desc" ]],
columnDefs: [{ width: '10%', targets: 0 }, columnDefs: [{ width: '10%', targets: 0 },
{ width: '10%', targets: 1 }, { width: '10%', targets: 1 },
{ width: '60%', targets: 2 }, { width: '60%', targets: 2 },
{ width: '20%', targets: 3 }], { width: '20%', targets: 3 }],
initComplete: function (settings, json) {
$('[data-bs-toggle="tooltip"]').tooltip({html: true});
}
}).on('draw', function() {
$('[data-bs-toggle="tooltip"]').tooltip({html: true});
}); });
</script> </script>
@ -23,20 +30,12 @@
<tr> <tr>
<td>{{ info['total_captures'] }}</td> <td>{{ info['total_captures'] }}</td>
<td> <td>
<a href="{{ url_for('get_ressource', tree_uuid=tree_uuid, node_uuid=info['node'].uuid) }}"> {{popup_icons_response(info['node'], tree_uuid)}}
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}" </td>
width="21" height="21" <td>
{% if info['node'].generic_type == "image" %} <p class="text-break">{{ info['node'].name }}</p>
data-bs-toggle="tooltip" data-bs-placement="left" data-bs-html="true" data-container="#bodyHashesTable" <a href="#/" onclick="openTreeInNewTab('{{ tree_uuid }}', '{{ info['node'].uuid }}')">Show on tree</a>
title='<img class="ressource_preview" src="{{ url_for('get_ressource_preview', tree_uuid=tree_uuid, node_uuid=info['node'].uuid) }}"/> </br>Click to download.'
{% else %}
data-bs-toggle="tooltip" data-bs-placement="left" data-bs-html="true" data-container="#bodyHashesTable"
title="{{icon_info['tooltip']}} <br/>Click to download."
{% endif %}
/>
</a>
</td> </td>
<td><p class="text-break">{{ info['node'].name }}</p></td>
<td> <td>
<span class="d-inline-block text-truncate" style="max-width: 200px;"> <span class="d-inline-block text-truncate" style="max-width: 200px;">
<a href="#bodyHashDetailsModal" data-remote="{{ url_for('body_hash_details', body_hash=body_hash) }}" <a href="#bodyHashDetailsModal" data-remote="{{ url_for('body_hash_details', body_hash=body_hash) }}"

View File

@ -1,9 +1,8 @@
<script type="text/javascript"> <script type="text/javascript">
new DataTable('#faviconsTable', { new DataTable('#identifiersTable', {
columnDefs: [{ width: '10%', targets: 0 }, columnDefs: [{ width: '20%', targets: 0 },
{ width: '40%', targets: 1 }, { width: '40%', targets: 1 },
{ width: '40%', targets: 2 }, { width: '40%', targets: 2 }],
{ width: '10%', targets: 3 }],
}); });
</script> </script>