make cluster resource counters more readable (add commas or convert amounts to more readable measurements) #9552

Closed
opened 2025-12-29 20:51:21 +01:00 by adam · 2 comments
Owner

Originally created by @ITJamie on GitHub (Apr 27, 2024).

Originally assigned to: @Julio-Oliveira-Encora on GitHub.

NetBox version

v4.0-beta1

Feature type

Change to existing functionality

Proposed functionality

adjust the resource counters on the cluster view page to add comma's or change from MB -> GB -> TB
Screenshot 2024-04-26 at 23 47 29

right now it can be kind of unreadable for larger clusters

Use case

when viewing clusters with a large amount of assigned resources (high amounts of ram , CPU or storage) it can be a little hard to read (especially memory as its in MB)

Database changes

n/a

External dependencies

n/a

Originally created by @ITJamie on GitHub (Apr 27, 2024). Originally assigned to: @Julio-Oliveira-Encora on GitHub. ### NetBox version v4.0-beta1 ### Feature type Change to existing functionality ### Proposed functionality adjust the resource counters on the cluster view page to add comma's or change from MB -> GB -> TB <img width="600" alt="Screenshot 2024-04-26 at 23 47 29" src="https://github.com/netbox-community/netbox/assets/1613241/3866c53c-ab39-4528-968b-375037b2fadc"> right now it can be kind of unreadable for larger clusters ### Use case when viewing clusters with a large amount of assigned resources (high amounts of ram , CPU or storage) it can be a little hard to read (especially memory as its in MB) ### Database changes n/a ### External dependencies n/a
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 20:51:21 +01:00
adam closed this issue 2025-12-29 20:51:21 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 29, 2024):

We have the humanize_megabytes() template filter in place which does this for certain values, but only for even multiples of 1024. E.g. a value of 4096 MB will display as 4 GB but a value of 4000 MB will not be converted. It seems reasonable to display fractional values, e.g. 2.5 GB, however we also want to ensure that the exact numeric value is always conveyed somehow.

@jeremystretch commented on GitHub (Apr 29, 2024): We have the [`humanize_megabytes()`](https://github.com/netbox-community/netbox/blob/85db007ff585370b03b2d88d8f43e6fa9b94bc8e/netbox/utilities/templatetags/helpers.py#L95) template filter in place which does this for certain values, but only for even multiples of 1024. E.g. a value of 4096 MB will display as 4 GB but a value of 4000 MB will not be converted. It seems reasonable to display fractional values, e.g. 2.5 GB, however we also want to ensure that the exact numeric value is always conveyed somehow.
Author
Owner

@Julio-Oliveira-Encora commented on GitHub (Apr 29, 2024):

Could you please assign it to me?

@Julio-Oliveira-Encora commented on GitHub (Apr 29, 2024): Could you please assign it to me?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9552