fix: show stateless services in overview

This commit is contained in:
2023-07-02 14:20:23 +02:00
parent d4894f39d8
commit 8fc4fca2a1
2 changed files with 44 additions and 19 deletions

View File

@@ -26,20 +26,24 @@
<body>
<div class="container">
<div class="row">
{% for service in services %}
{% for status in status_list %}
<div class="col-md-5 m-3 p-2 border rounded"
{% if service[0].status == "OK" %}
{% if status.status == "OK" %}
style="background-color: lightgreen;"
{% elif service[0].status == "WARNING" %}
{% elif status.status == "WARNING" %}
style="background-color: orange;"
{% elif service[0].status == "CRITICAL" %}
{% elif status.status == "CRITICAL" %}
style="background-color: #ff00005c;"
{% else %}
style="background-color: magenta;"
{% endif %}
>
<p class="w-100 font-weight-bold">{{ service[0].service }}</p>
{{ datetime.fromtimestamp(service[0].timestamp).strftime("%H:%M %d.%m.%y") }}
<p class="w-100 font-weight-bold">{{ status.service }}</p>
{% if status.timestamp == 0 %}
Service never reported in
{% else %}
{{ datetime.fromtimestamp(status.timestamp).strftime("%H:%M %d.%m.%y") }}
{% endif %}
</div>
{% endfor %}
</div>