Fix CSS and stat precision issues with the Server Cache admin widget.

Review Request #11614 — Created May 24, 2021 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

The Server Cache administration widget had some precision errors when
running on Python 3, due to differences in division. We now explicitly
opt into the division future, for Python 2.7, and explciitly format
the numbers in all cases. This gives us the same results as in Review
Board 3, with the addition of 2 digits of precision we now provide for
the percentages.

The lines in the widget are also now left-aligned. Due to a regression,
they were center-aligned in 4.0.0.

Tested the widget on both Python 2.7 and 3.x, ensuring the appearance was
correct and the same between both.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix CSS and stat precision issues with the Server Cache admin widget.
The Server Cache administration widget had some precision errors when running on Python 3, due to differences in division. We now explicitly opt into the `division` future, for Python 2.7, and explciitly format the numbers in all cases. This gives us the same results as in Review Board 3, with the addition of 2 digits of precision we now provide for the percentages. The lines in the widget are also now left-aligned. Due to a regression, they were center-aligned in 4.0.0.
38b0d66d97f498527a47af07afa0abba6582e069 Christian Hammond
reviewboard/admin/cache_stats.py
reviewboard/admin/widgets.py
reviewboard/static/rb/css/pages/admin/dashboard.less
reviewboard/templates/admin/cache_stats.html
reviewboard/templates/admin/widgets/w-server-cache.html
Loading...