Skip to content

Commit

Permalink
Improve health check display (#1209)
Browse files Browse the repository at this point in the history
* improve health check status display

* add more cases

* show pass or not according to error_message

* fix typo
  • Loading branch information
liyaqin1 committed Jun 17, 2023
1 parent c8b8032 commit 1bcdf08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
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

0 comments on commit 1bcdf08

Please sign in to comment.