mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Closes #10268: Omit trailing ".0" in device positions within UI
This commit is contained in:
parent
1cbb2320c1
commit
b702822857
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v3.3.3 (FUTURE)
|
## v3.3.3 (FUTURE)
|
||||||
|
|
||||||
|
### Enhancements
|
||||||
|
|
||||||
|
* [#10268](https://github.com/netbox-community/netbox/issues/10268) - Omit trailing ".0" in device positions within UI
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#9231](https://github.com/netbox-community/netbox/issues/9231) - Fix `empty` lookup expression for string filters
|
* [#9231](https://github.com/netbox-community/netbox/issues/9231) - Fix `empty` lookup expression for string filters
|
||||||
|
@ -152,6 +152,9 @@ class DeviceTable(TenancyColumnsMixin, NetBoxTable):
|
|||||||
rack = tables.Column(
|
rack = tables.Column(
|
||||||
linkify=True
|
linkify=True
|
||||||
)
|
)
|
||||||
|
position = columns.TemplateColumn(
|
||||||
|
template_code='{{ value|floatformat }}'
|
||||||
|
)
|
||||||
device_role = columns.ColoredLabelColumn(
|
device_role = columns.ColoredLabelColumn(
|
||||||
verbose_name='Role'
|
verbose_name='Role'
|
||||||
)
|
)
|
||||||
@ -199,10 +202,10 @@ class DeviceTable(TenancyColumnsMixin, NetBoxTable):
|
|||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = Device
|
model = Device
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'status', 'tenant', 'tenant_group', 'device_role', 'manufacturer', 'device_type', 'platform', 'serial',
|
'pk', 'id', 'name', 'status', 'tenant', 'tenant_group', 'device_role', 'manufacturer', 'device_type',
|
||||||
'asset_tag', 'site', 'location', 'rack', 'position', 'face', 'primary_ip', 'airflow', 'primary_ip4',
|
'platform', 'serial', 'asset_tag', 'site', 'location', 'rack', 'position', 'face', 'primary_ip', 'airflow',
|
||||||
'primary_ip6', 'cluster', 'virtual_chassis', 'vc_position', 'vc_priority', 'comments', 'contacts', 'tags',
|
'primary_ip4', 'primary_ip6', 'cluster', 'virtual_chassis', 'vc_position', 'vc_priority', 'comments',
|
||||||
'created', 'last_updated',
|
'contacts', 'tags', 'created', 'last_updated',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'name', 'status', 'tenant', 'site', 'location', 'rack', 'device_role', 'manufacturer', 'device_type',
|
'pk', 'name', 'status', 'tenant', 'site', 'location', 'rack', 'device_role', 'manufacturer', 'device_type',
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% elif object.rack and object.position %}
|
{% elif object.rack and object.position %}
|
||||||
<span>U{{ object.position }} / {{ object.get_face_display }}</span>
|
<span>U{{ object.position|floatformat }} / {{ object.get_face_display }}</span>
|
||||||
{% elif object.rack and object.device_type.u_height %}
|
{% elif object.rack and object.device_type.u_height %}
|
||||||
<span class="badge bg-warning">Not racked</span>
|
<span class="badge bg-warning">Not racked</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
<td>{{ device.pk }}</td>
|
<td>{{ device.pk }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if device.rack %}
|
{% if device.rack %}
|
||||||
{{ device.rack }} / {{ device.position }}
|
{{ device.rack }} / {{ device.position|floatformat }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ ''|placeholder }}
|
{{ ''|placeholder }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user