mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-24 04:22:41 -06:00
15873 - Make Cluster resource counters more readable (#15900)
* Created "convert_byte_size" method to convert the memory and disk size according to unit informed. Changed "get_extra_context" method from "ClusterView" to use the method above and convert all the disks and memories from VMs to normalize the units. * Changed decimal size for memory_sum and disk_sum * Added test for convert_byte_size. * Fixed * Addressed PR comments. Changed humanize_megabytes in helpers.py * Addressed PR comments. Changed humanize_megabytes in helpers.py * Linter issues for helpers.py * Changed humanize_megabytes * Changed humanize_megabytes * Changed humanize_megabytes * Added the title to display the value in MB when mouseover. * Addressed PR comment. * Addressed PR comment. * Rewrite sizing logic --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
committed by
GitHub
parent
3acf3b51ee
commit
7e1b3d0b54
@@ -59,7 +59,7 @@
|
||||
<th scope="row"><i class="mdi mdi-chip"></i> {% trans "Memory" %}</th>
|
||||
<td>
|
||||
{% if memory_sum %}
|
||||
{{ memory_sum|humanize_megabytes }}
|
||||
<span title={{ memory_sum }}>{{ memory_sum|humanize_megabytes }}</span>
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
{% endif %}
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<th scope="row"><i class="mdi mdi-chip"></i> {% trans "Memory" %}</th>
|
||||
<td>
|
||||
{% if object.memory %}
|
||||
{{ object.memory|humanize_megabytes }}
|
||||
<span title={{ object.memory }}>{{ object.memory|humanize_megabytes }}</span>
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user