From 717d97467f6e40b29c7aea76c95c4555729c34b9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 18 Apr 2021 13:49:57 -0400 Subject: [PATCH] feat: highlight HTTP status code 0 (or undefined) closes #267 --- src/css-raw/perf-cascade.css | 6 ++++++ src/ts/transformers/helpers.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/css-raw/perf-cascade.css b/src/css-raw/perf-cascade.css index 729f428..bbdb34a 100755 --- a/src/css-raw/perf-cascade.css +++ b/src/css-raw/perf-cascade.css @@ -39,19 +39,25 @@ .row-item:focus .even {fill: #000; opacity: 0.2; } .row-item .rect-holder text {fill: #aaa} +.row-item.status0 .even, .row-item.status5xx .even {fill: #f66;} +.row-item.status0 .odd, .row-item.status5xx .odd {fill: #f00;} .row-item.status4xx .even{fill: #c33;} .row-item.status4xx .odd {fill: #c00;} .row-item.status3xx .even {fill: #ff6;} .row-item.status3xx .odd {fill: #ff0;} +.row-item.status0 .even, +.row-item.status0 .odd, .row-item.status5xx .even, .row-item.status5xx .odd, .row-item.status4xx .even, .row-item.status4xx .odd, .row-item.status3xx .even, .row-item.status3xx .odd {opacity: 0.3;} +.row-item.status0:hover .even, +.row-item.status0:hover .odd, .row-item.status5xx:hover .even, .row-item.status5xx:hover .odd, .row-item.status4xx:hover .even, diff --git a/src/ts/transformers/helpers.ts b/src/ts/transformers/helpers.ts index a6f3f8a..6a4e1c2 100644 --- a/src/ts/transformers/helpers.ts +++ b/src/ts/transformers/helpers.ts @@ -132,6 +132,9 @@ export function makeRowCssClasses(status: number): string { isInStatusCodeRange(status, 300, 399)) { // 304 == Not Modified, so not an issue classes.push("status3xx"); + } else if (status === 0 || status === undefined) { + // eg connection refused, or connection timeout etc then the http status code defaults to 0 + classes.push("status0"); } return classes.join(" "); }