From fed136aadae595a1621a2eaf3ccb48d62193dca3 Mon Sep 17 00:00:00 2001 From: aarya-16 Date: Tue, 15 Oct 2024 03:13:41 +0530 Subject: [PATCH 1/2] Added groups to history page --- history.html.theme | 35 ++++++++++++++++++++++------------- tinystatus.py | 19 ++++++++++++------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/history.html.theme b/history.html.theme index e12403b..cb531e1 100644 --- a/history.html.theme +++ b/history.html.theme @@ -45,11 +45,13 @@ color: var(--heading-color); text-align: center; } + .history-group { + margin-bottom: 40px; + } .history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; - margin-bottom: 40px; } .history-item { background: var(--card-bg); @@ -59,7 +61,7 @@ max-height: 300px; overflow: auto; } - .history-item h2 { + .history-item h3 { font-size: 1.2rem; margin: 0; } @@ -86,21 +88,28 @@

TinyStatus History

-
- {% for service, entries in history.items() %} -
-

{{ service }}

- {% for entry in entries|reverse %} -
- {{ entry.timestamp.split('T')[0] }} {{ entry.timestamp.split('T')[1][:8] }} - - {{ 'Up' if entry.status else 'Down' }} - + + {% for group in history.groups %} +
+

{{ group.title }}

+
+ {% for service, entries in group.checks.items() %} +
+

{{ service }}

+ {% for entry in entries|reverse %} +
+ {{ entry.timestamp.split('T')[0] }} {{ entry.timestamp.split('T')[1][:8] }} + + {{ 'Up' if entry.status else 'Down' }} + +
+ {% endfor %}
{% endfor %}
- {% endfor %}
+ {% endfor %} +