Skip to content

Conversation

@wjhoward
Copy link
Contributor

@wjhoward wjhoward commented Aug 25, 2023

1st pass at adding style and colors to the printer view. Related to issue: #64
I've tried to abstract the style and colors configuration into the StyleScheme struct.
I also made a minor adjustment to the monitor colors to make it consistent with the printer colors.

Code respects the --disable-color flag (but maintains the style changes, e.g. bold / underlined).
I used the crossterm style system which I believe tui uses, so this should be compatible with the same terminals the current code is compatible with.

The color style includes thresholds for certain values:

  • success rate: 100 = green, > 99 = yellow, < 99 = red
  • response latency: < 0.3 = green, 0.3 - 0.8 = yellow, > 0.8 = red
  • HTTP status: success = green, client error = yellow, server error = red

Here's an example of how the printer view looks:
image

Copy link
Owner

@hatoo hatoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I left just one review!

@hatoo
Copy link
Owner

hatoo commented Aug 26, 2023

Clippy fail is OK. It's false positive.

@wjhoward
Copy link
Contributor Author

Just pushed the StyleScheme String to &str change.
My plan is to next test this change on Ubuntu and Windows (already tested on MacOS).
I can then also update the demo.gif

@hatoo
Copy link
Owner

hatoo commented Aug 26, 2023

I can then also update the demo.gif

This is really great, could you update CHANGELOG.md also?

@wjhoward wjhoward requested a review from hatoo August 26, 2023 08:59
@wjhoward
Copy link
Contributor Author

wjhoward commented Aug 26, 2023

Manual testing looked fine. The demo.gif is larger to contain the full summary view, hopefully that's okay for the README page.
In future it would be nice to support configurable thresholds.

@hatoo hatoo merged commit 37d3ba6 into hatoo:master Aug 26, 2023
@hatoo
Copy link
Owner

hatoo commented Aug 26, 2023

LGTM. Thank you! 🎉

@wjhoward
Copy link
Contributor Author

LGTM. Thank you! 🎉

No problem, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants