Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve health check display #1209

Merged
merged 4 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<th class="col-lg-1">Details</th>
</tr>
{% for health_check in health_checks %}
<tr class="{{ health_check.status | healthCheckStatusClass }}">
<tr class="{{ health_check.error_message | healthCheckStatusClass }}">
<td>{{ health_check.start_time | convertTimestamp }}</td>
<td><span class="deployToolTip label label-default" data-toggle="tooltip"
title="Health Check was updated on {{ health_check.last_worked_on | convertTimestamp }}">
Expand Down Expand Up @@ -44,7 +44,13 @@
STATE SUCCEEDED
{% elif health_check.status == "QUALIFIED" %}
QUALIFIED (pending termination)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.state == "COMPLETED" %}
{% elif health_check.error_message and health_check.host_terminated == 1 %}
FAILED (terminated)
{% elif health_check.error_message and health_check.status == "TELETRAAN_STOP_REQUESTED" %}
FAILED (terminating)
{% elif health_check.error_message %}
FAILED (pending termination)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.host_terminated == 1 %}
QUALIFIED (terminated)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" %}
QUALIFIED (terminating)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ <h4 class="panel-title pull-left">
STATE SUCCEEDED
{% elif health_check.status == "QUALIFIED" %}
QUALIFIED (pending termination)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.state == "COMPLETED" %}
{% elif health_check.error_message and health_check.host_terminated == 1 %}
FAILED (terminated)
{% elif health_check.error_message and health_check.status == "TELETRAAN_STOP_REQUESTED" %}
FAILED (terminating)
{% elif health_check.error_message %}
FAILED (pending termination)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.host_terminated == 1 %}
QUALIFIED (terminated)
{% elif health_check.status == "TELETRAAN_STOP_REQUESTED" %}
QUALIFIED (terminating)
Expand Down
8 changes: 3 additions & 5 deletions deploy-board/deploy_board/webapp/templatetags/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,13 +905,11 @@ def genImageInfo(value):


@register.filter("healthCheckStatusClass")
def healthCheckStatusClass(status):
if status == "FAILED":
def healthCheckStatusClass(error_message):
if error_message:
return "danger"
elif status == "TELETRAAN_STOP_REQUESTED":
return "success"
else:
return ""
return "success"


@register.filter("healthCheckStatusIcon")
Expand Down
Loading