From af0a7fe3cc57c9b2376dee38a6949fc080e07d39 Mon Sep 17 00:00:00 2001 From: Yaqin Li Date: Fri, 16 Jun 2023 15:39:34 -0700 Subject: [PATCH 1/4] improve health check status display --- .../templates/groups/health_check_activities.tmpl | 6 +++++- .../deploy_board/templates/groups/health_check_details.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl index 092cbf39b9..fa220855bd 100644 --- a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl +++ b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl @@ -44,7 +44,11 @@ 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 %} + FAILED + {% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.host_terminated == 1 %} QUALIFIED (terminated) {% elif health_check.status == "TELETRAAN_STOP_REQUESTED" %} QUALIFIED (terminating) diff --git a/deploy-board/deploy_board/templates/groups/health_check_details.html b/deploy-board/deploy_board/templates/groups/health_check_details.html index 22ef73fdde..95d75942d0 100644 --- a/deploy-board/deploy_board/templates/groups/health_check_details.html +++ b/deploy-board/deploy_board/templates/groups/health_check_details.html @@ -109,7 +109,11 @@

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 %} + FAILED + {% elif health_check.status == "TELETRAAN_STOP_REQUESTED" and health_check.host_terminated == 1 %} QUALIFIED (terminated) {% elif health_check.status == "TELETRAAN_STOP_REQUESTED" %} QUALIFIED (terminating) From f6eeb8cd39657ac44eb34a1578d7573aa86583cd Mon Sep 17 00:00:00 2001 From: Yaqin Li Date: Fri, 16 Jun 2023 16:12:31 -0700 Subject: [PATCH 2/4] add more cases --- .../templates/groups/health_check_activities.tmpl | 4 +++- .../deploy_board/templates/groups/health_check_details.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl index fa220855bd..07a753f1a8 100644 --- a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl +++ b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl @@ -46,8 +46,10 @@ QUALIFIED (pending termination) {% 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 + 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" %} diff --git a/deploy-board/deploy_board/templates/groups/health_check_details.html b/deploy-board/deploy_board/templates/groups/health_check_details.html index 95d75942d0..acf887b6bd 100644 --- a/deploy-board/deploy_board/templates/groups/health_check_details.html +++ b/deploy-board/deploy_board/templates/groups/health_check_details.html @@ -111,8 +111,10 @@

QUALIFIED (pending termination) {% 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 + 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" %} From a911eb3deb4bc202fe4d3b40dc42df347837d756 Mon Sep 17 00:00:00 2001 From: Yaqin Li Date: Fri, 16 Jun 2023 16:29:22 -0700 Subject: [PATCH 3/4] show pass or not according to error_message --- .../templates/groups/health_check_activities.tmpl | 2 +- deploy-board/deploy_board/webapp/templatetags/utils.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl index 07a753f1a8..8f42150567 100644 --- a/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl +++ b/deploy-board/deploy_board/templates/groups/health_check_activities.tmpl @@ -14,7 +14,7 @@ Details {% for health_check in health_checks %} - + {{ health_check.start_time | convertTimestamp }} diff --git a/deploy-board/deploy_board/webapp/templatetags/utils.py b/deploy-board/deploy_board/webapp/templatetags/utils.py index 7ed26a2a28..d3f185965f 100644 --- a/deploy-board/deploy_board/webapp/templatetags/utils.py +++ b/deploy-board/deploy_board/webapp/templatetags/utils.py @@ -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": + else return "success" - else: - return "" @register.filter("healthCheckStatusIcon") From d5eb9f4a37b6aae9e2c50115184ae15421b6ed49 Mon Sep 17 00:00:00 2001 From: Yaqin Li Date: Fri, 16 Jun 2023 16:39:05 -0700 Subject: [PATCH 4/4] fix typo --- deploy-board/deploy_board/webapp/templatetags/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-board/deploy_board/webapp/templatetags/utils.py b/deploy-board/deploy_board/webapp/templatetags/utils.py index d3f185965f..e0be1e0eff 100644 --- a/deploy-board/deploy_board/webapp/templatetags/utils.py +++ b/deploy-board/deploy_board/webapp/templatetags/utils.py @@ -908,7 +908,7 @@ def genImageInfo(value): def healthCheckStatusClass(error_message): if error_message: return "danger" - else + else: return "success"