You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2020/11/06 17:08:31 UTC

[trafficcontrol] branch 4.1.x updated: [4.1.x backport] Fix TM UI bug with DS available logic #4900 (#5255)

This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch 4.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/4.1.x by this push:
     new 09377cc  [4.1.x backport] Fix TM UI bug with DS available logic #4900 (#5255)
09377cc is described below

commit 09377ccea6356cfe94e64e27626682ab3748617b
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Fri Nov 6 10:08:20 2020 -0700

    [4.1.x backport] Fix TM UI bug with DS available logic #4900 (#5255)
    
    * Fix TM UI bug with DS available logic (#4900)
    
    (cherry picked from commit fb0660241fda31efa033c1c78263c8f2b859e0f1)
    
    * Add changelog entry
    
    Co-authored-by: Robert O Butts <ro...@users.noreply.github.com>
---
 CHANGELOG.md                     | 1 +
 traffic_monitor/static/script.js | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c39c5f..56e3b35 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 - Fixed #5005: Traffic Monitor cannot be upgraded independently of Traffic Ops
 - Fixed an issue with Traffic Router failing to authenticate if secrets are changed
 - Fixed #4825 - Traffic Monitor error log spamming "incomparable stat type int"
+- Fixed #4899 - Traffic Monitor Web UI showing incorrect delivery service availability states
 - Fixed #4845 - issue with ATS logging.yaml generation (missing newlines when filters are used)
 - Fixed ORT atstccfg to use log appending and log rotation
 - Fixed a bug in ATS remap.config generation that caused a double range directive if there was a `__RANGE_DIRECTIVE__` override
diff --git a/traffic_monitor/static/script.js b/traffic_monitor/static/script.js
index 8a3698a..e3d0391 100644
--- a/traffic_monitor/static/script.js
+++ b/traffic_monitor/static/script.js
@@ -232,8 +232,8 @@ function getDsStats() {
 
 		for (const [dsName, deliveryService] of deliveryServices) {
 			const row = table.insertRow(0);
-			const available = !deliveryService.isAvailable || !deliveryService.isAvailable[0] || !deliveryService.isAvailable[0].value === "true";
-			if (available) {
+			const available = deliveryService.isAvailable && deliveryService.isAvailable[0] && deliveryService.isAvailable[0].value === "true";
+			if (!available) {
 				row.classList.add("error");
 			}