lookyloo/website/web/templates/cookie_name.html

67 lines
2.0 KiB
HTML

{% extends "main.html" %}
{% from "macros.html" import shorten_string %}
{% block scripts %}
{{ super() }}
<script type="text/javascript" nonce="{{ csp_nonce() }}">
new DataTable('#cookieNameTable', {
order: [[ 0, "desc" ]],
columnDefs: [{ width: '30%', targets: 0,
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();
}
},
{ width: '70%', targets: 1 }]
});
</script>
<script type="text/javascript" nonce="{{ csp_nonce() }}">
const openNewTabButtons = document.querySelectorAll('.openNewTab');
if (openNewTabButtons) {
openNewTabButtons.forEach(el => el.addEventListener('click', event => {
window.opener.openTreeInNewTab(el.dataset.capture, el.dataset.hostnode);
}));
}
</script>
{% endblock %}
{% block content %}
<center>
<h4>{{ cookie_name }}</h4>
<h6>Only the most recent captures are listed below, this will change soon.</h6>
</center>
<table id="cookieNameTable" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Capture Time</th>
<th>Capture Title</th>
</tr>
</thead>
<tbody>
{% for capture_uuid, title, capture_time, nodes in captures %}
<tr>
<td>
{{capture_time}}
</td>
<td>
<a href="{{ url_for('tree', tree_uuid=capture_uuid) }}">
{{ title }}
</a>
<br>
The capture contains this URL in {{ nodes|length }} nodes, click below to see them on the tree:
<ul>
{% for node in nodes %}
<li>
<button type="button" class="btn btn-link openNewTab" data-capture="{{capture_uuid}}" data-hostnode="{{node}}">{{ node }}</button>
</li>
{% endfor %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}