diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 99d6cb9e..1281b636 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -272,7 +272,11 @@ class Lookyloo(): def get_statistics(self, capture_uuid: str) -> Dict[str, Any]: '''Get the statistics of a capture.''' ct = self.get_crawled_tree(capture_uuid) - return ct.root_hartree.stats + stats = ct.root_hartree.stats + node, distance = ct.root_hartree.hostname_tree.get_farthest_leaf() + stats['tree_depth'] = int(distance) + 1 + stats['total_redirects'] = len(ct.redirects) + return stats def get_meta(self, capture_uuid: str) -> Dict[str, str]: '''Get the meta informations from a capture (mostly, details about the User Agent used.)''' diff --git a/website/web/static/tree.js b/website/web/static/tree.js index bcf2b4c6..6434bb97 100644 --- a/website/web/static/tree.js +++ b/website/web/static/tree.js @@ -3,7 +3,7 @@ // Set the dimensions and margins of the diagram let margin = { - top: document.getElementById('tree-details').clientHeight, + top: 20, right: 200, bottom: 10, left: 90 diff --git a/website/web/templates/statistics.html b/website/web/templates/statistics.html index 5b5908a0..12fe9e91 100644 --- a/website/web/templates/statistics.html +++ b/website/web/templates/statistics.html @@ -1,10 +1,24 @@
-{% if stats %} - {% for key, value in stats.items() %} -
-
{{ key }}
-
{{ value }}
-
- {% endfor %} -{% endif%} +
+
Hostnames
+
{{ stats['total_hostnames'] }}
+ +
Unique URLs
+
{{ stats['total_urls'] }}
+ +
Cookies Received
+
{{ stats['total_cookies_received'] }}
+ +
Cookies Sent
+
{{ stats['total_cookies_sent'] }}
+ +
Node Depth
+
{{ stats['tree_depth'] }}
+ +
Total Nodes
+
{{ stats['total_hostnames'] }}
+ +
Redirects
+
{{ stats['total_redirects'] }}
+
diff --git a/website/web/templates/tree.html b/website/web/templates/tree.html index 4076f95f..d4c6e51f 100644 --- a/website/web/templates/tree.html +++ b/website/web/templates/tree.html @@ -88,8 +88,8 @@ }); {% else %} window.addEventListener('DOMContentLoaded', (event) => { - let element = document.getElementById(`node_${center_node}`); - element.scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); + let thumbnail = document.getElementById('screenshot_thumbnail'); + thumbnail.scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); }); {% endif%} @@ -113,7 +113,7 @@ var capture_starttime = new Date(Date.parse("{{ start_time }}")); window.addEventListener('DOMContentLoaded', (event) => { document.getElementById("start_time").innerHTML = - `Capture time: ${capture_starttime.getFullYear()}-${("0" + (capture_starttime.getMonth() + 1)).slice(-2)}-${("0" + capture_starttime.getDate()).slice(-2)} ${capture_starttime.toLocaleTimeString()}`; + `${capture_starttime.getFullYear()}-${("0" + (capture_starttime.getMonth() + 1)).slice(-2)}-${("0" + capture_starttime.getDate()).slice(-2)} ${capture_starttime.toLocaleTimeString()}`; }); @@ -148,11 +148,32 @@ @@ -279,44 +282,45 @@ -
-
-
-
-
- Details of the capture at the time it happened -
-
- -
-
-
-

URL captured: {{ shorten_string(root_url, 150) }}

-

Page title: {{ page_title }}

-

-

User Agent: {{ user_agent }}

- {% if meta %} - {% for k, v in meta.items() if k not in ['user_agent'] %} -

{{k.title()}}: {{ v }}

- {% endfor %} - {%endif%} + +
-
-
- -
- -