mirror of https://github.com/CIRCL/lookyloo
chg: More macros
parent
419fe7408b
commit
c7db7829a7
|
@ -759,12 +759,6 @@ class Lookyloo():
|
||||||
'url_object': url
|
'url_object': url
|
||||||
}
|
}
|
||||||
|
|
||||||
# If the url path is too long, we want to limit it to 60 chars
|
|
||||||
if len(to_append['url_path']) > 50:
|
|
||||||
to_append['url_path_short'] = to_append['url_path'][:60] + ' [...]'
|
|
||||||
else:
|
|
||||||
to_append['url_path_short'] = to_append['url_path']
|
|
||||||
|
|
||||||
if not url.empty_response:
|
if not url.empty_response:
|
||||||
# Index lookup
|
# Index lookup
|
||||||
# %%% Full body %%%
|
# %%% Full body %%%
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{% from "macros.html" import indexed_hash %}
|
{% from "macros.html" import indexed_hash %}
|
||||||
{% from "macros.html" import indexed_cookies %}
|
{% from "macros.html" import indexed_cookies %}
|
||||||
{% from "macros.html" import popup_icons %}
|
{% from "macros.html" import popup_icons %}
|
||||||
|
{% from "macros.html" import shorten_string %}
|
||||||
|
|
||||||
{% block title %}Details for {{ hostname }} {% endblock %}
|
{% block title %}Details for {{ hostname }} {% endblock %}
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
{# URL #}
|
{# URL #}
|
||||||
... /{{ url['url_path_short'] }}
|
... /{{ shorten_string(url['url_path'], 50)}}
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
|
|
|
@ -103,3 +103,11 @@ The same file was seen in <b>{{ total_captures }}</b> other captures.
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro shorten_string(string, cut_length) %}
|
||||||
|
{% if string|length > cut_length %}
|
||||||
|
{{ string[:cut_length] }} [...]
|
||||||
|
{% else %}
|
||||||
|
{{ string }}
|
||||||
|
{%endif%}
|
||||||
|
{% endmacro %}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends "main.html" %}
|
{% extends "main.html" %}
|
||||||
|
|
||||||
{% from 'bootstrap/utils.html' import render_messages %}
|
{% from 'bootstrap/utils.html' import render_messages %}
|
||||||
|
{% from "macros.html" import shorten_string %}
|
||||||
|
|
||||||
{% block title %}Tree{% endblock %}
|
{% block title %}Tree{% endblock %}
|
||||||
|
|
||||||
|
@ -143,12 +144,7 @@
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<b>Root URL</b>:
|
<b>Root URL</b>: {{ shorten_string(root_url, 150) }}
|
||||||
{% if root_url|length > 150 %}
|
|
||||||
{{ root_url[:150] }} [...]
|
|
||||||
{% else %}
|
|
||||||
{{ root_url}}
|
|
||||||
{% endif %}
|
|
||||||
<br>
|
<br>
|
||||||
<b>Start time</b>: {{ start_time }}<br>
|
<b>Start time</b>: {{ start_time }}<br>
|
||||||
<b>User Agent</b>: {{ user_agent }}<br>
|
<b>User Agent</b>: {{ user_agent }}<br>
|
||||||
|
|
Loading…
Reference in New Issue