summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-03-23 22:24:06 +0100
committeruser <user@node5.net>2024-03-23 22:24:06 +0100
commitb70a9b7ed2f5ebea9d35d9bdf4a666b8cfdce29b (patch)
tree3d20ef20b2835e004489b01f853c861350a2b14a /src/templates
parente06d7f926833d6fba19e57cb2211696e0bdbc6ad (diff)
chart stacked grouped by ip address
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/chart.html32
-rw-r--r--src/templates/index.html11
2 files changed, 35 insertions, 8 deletions
diff --git a/src/templates/chart.html b/src/templates/chart.html
new file mode 100644
index 0000000..4536784
--- /dev/null
+++ b/src/templates/chart.html
@@ -0,0 +1,32 @@
+<canvas id="histogram"></canvas>
+
+{{ histogram_data|safe }}
+
+{{ histogram_labels|safe }}
+
+<script defer>
+ var datasets = {{ histogram_data|safe }}
+
+ /*
+ [
+ {
+ label: 'Page Views',
+ data: [5000, 7500, 8000, 6000, 9000],
+ backgroundColor: 'hsl(0, 100%, 50%)',
+ borderColor: 'rgba(75, 192, 192, 1)',
+ borderWidth: 2,
+ fill: 'start'
+ },
+ {
+ label: 'Page Views2',
+ data: [0, 0, 1100, 400, 1000],
+ backgroundColor: 'rgba(75, 192, 192, 0.5)',
+ borderColor: 'rgba(75, 192, 192, 1)',
+ borderWidth: 2,
+ fill: 'start'
+ },
+
+ ]
+ */
+ var labels = {{ histogram_labels|safe }};
+</script>
diff --git a/src/templates/index.html b/src/templates/index.html
index e5f602b..8b2d0c0 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SSH login attempts</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/bootstrap-5.3.3-dist/css/bootstrap.min.css">
<script src="/chartjs/chart.umd.js" defer></script>
<script type="module" src="/histogram.js" defer></script>
@@ -26,7 +27,7 @@
</div>
<div class="row">
<div class="col">
- <canvas id="histogram"></canvas>
+ {% include 'chart.html' %}
</div>
</div>
<div class="row">
@@ -50,15 +51,9 @@
</div>
</div>
- <p>Do you like living life dangerously? use <a href="/password_of_the_month">password of the month</a>
+ <p>Do you like living life dangerously? use <a href="/potm">password of the month</a>
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