summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-03-23 18:52:37 +0100
committeruser <user@node5.net>2024-03-23 18:52:37 +0100
commite06d7f926833d6fba19e57cb2211696e0bdbc6ad (patch)
treea3a79b5ec8d0ee254950b53cb9f894e946c7bea9 /src/templates
parentf379b1c78cc224581fac16541e5bc3b6ccbc5dd1 (diff)
add login attempts chart
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/index.html22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/templates/index.html b/src/templates/index.html
index d90be7c..e5f602b 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -5,7 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SSH login attempts</title>
<link rel="stylesheet" href="/bootstrap-5.3.3-dist/css/bootstrap.min.css">
- <link rel="stylesheet" href="style.css">
+ <script src="/chartjs/chart.umd.js" defer></script>
+ <script type="module" src="/histogram.js" defer></script>
</head>
<body>
@@ -25,21 +26,26 @@
</div>
<div class="row">
<div class="col">
+ <canvas id="histogram"></canvas>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col">
<h3>Top usernames</h3>
{% with data=top_usernames %}
- {% include 'table.html' %}
+ {% include 'table.html' %}
{% endwith %}
</div>
<div class="col">
<h3>Top passwords</h3>
{% with data=top_passwords %}
- {% include 'table.html' %}
+ {% include 'table.html' %}
{% endwith %}
</div>
<div class="col">
<h3>Latest login attempts</h3>
- {% with data=latest_login_attempts %}
- {% include 'table.html' %}
+ {% with data=latest_login_attempts %}
+ {% include 'table.html' %}
{% endwith %}
</div>
</div>
@@ -48,5 +54,11 @@
as your next password</p>
</div>
+
+<script defer>
+ var data = {{ histogram_data|safe }};
+ var labels = {{ histogram_labels|safe }};
+</script>
+
</body>
</html> \ No newline at end of file