Skip to content

Commit

Permalink
feat: highlight HTTP status code 0 (or undefined)
Browse files Browse the repository at this point in the history
closes #267
  • Loading branch information
micmro committed Apr 18, 2021
1 parent 168f312 commit 717d974
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/css-raw/perf-cascade.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/ts/transformers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ");
}
Expand Down

0 comments on commit 717d974

Please sign in to comment.