Skip to content
Snippets Groups Projects
Commit c31d0f05 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'SDC-438-filters-on-dashboard' into 'master'

status is 'unknown' when late

See merge request !210
parents c46a25d1 0fcf79d2
Branches
No related tags found
2 merge requests!211status is 'unknown' when late,!210status is 'unknown' when late
Pipeline #26049 passed
......@@ -250,6 +250,9 @@ def convert_monitor_to_html(request, monitor_data):
try:
for record in monitor_data:
# iterate through the dict of key/values
d1 = datetime.utcnow().replace(tzinfo=None)
d2 = record.timestamp.replace(tzinfo=None)
delta = d1 - d2
# http://localhost:8000/atdb/monitor/?name=stager&hostname=localhost
link_to_service_history = construct_link_to_monitor_history(request, record.name, record.name, record.hostname)
......@@ -261,16 +264,14 @@ def convert_monitor_to_html(request, monitor_data):
#line += "<td><b>" + str(record.name) + "</b></td>"
line += "<td><b>" + link_to_service_history + "</b></td>"
line += "<td>" + str(record.hostname) + "</td>"
line += '<td class="' + record.status + '" >' + str(record.status) + "</td>"
d1 = datetime.utcnow().replace(tzinfo=None)
d2 = record.timestamp.replace(tzinfo=None)
delta = d1 - d2
# if the heartbeat is 30 minutes late, show '(late)' in red
if delta.seconds > 1800:
line += "<td><i>unknown</i></td>"
line += '<td class="error">' + str(record.timestamp.strftime(TIME_FORMAT)) + " - (late)</td>"
else:
line += '<td>' + str(record.timestamp) + "</td>"
line += '<td class="' + record.status + '" >' + str(record.status) + "</td>"
line += '<td>' + str(record.timestamp.strftime(TIME_FORMAT)) + "</td>"
line += "<td>" + str(record.process_id) + "</td>"
line += "<td>" + str(record.description) + "</td>"
line += "</tr>"
......
......@@ -34,7 +34,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 1.0.0 (4 mar 2021 - 11:00)
<p class="footer"> Version 1.0.0 (4 mar 2021 - 15:00)
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment