Skip to content

Commit

Permalink
Fixes #10973: Fix device links in VDC table
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Nov 18, 2022
1 parent 84c0c45 commit 9774bb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/version-3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [#10946](https://github.com/netbox-community/netbox/issues/10946) - Fix AttributeError exception when viewing a device with a primary IP and no platform assigned
* [#10948](https://github.com/netbox-community/netbox/issues/10948) - Linkify primary IPs for VDCs
* [#10957](https://github.com/netbox-community/netbox/issues/10957) - Add missing VDCs column to interface tables
* [#10973](https://github.com/netbox-community/netbox/issues/10973) - Fix device links in VDC table
* [#10980](https://github.com/netbox-community/netbox/issues/10980) - Fix view tabs for plugin objects

## v3.4-beta1 (2022-11-16)
Expand Down
9 changes: 6 additions & 3 deletions netbox/dcim/tables/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ class Meta(NetBoxTable.Meta):
class DeviceTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
name = tables.TemplateColumn(
order_by=('_name',),
template_code=DEVICE_LINK
template_code=DEVICE_LINK,
linkify=True
)
status = columns.ChoiceFieldColumn()
region = tables.Column(
Expand Down Expand Up @@ -220,7 +221,8 @@ class Meta(NetBoxTable.Meta):

class DeviceImportTable(TenancyColumnsMixin, NetBoxTable):
name = tables.TemplateColumn(
template_code=DEVICE_LINK
template_code=DEVICE_LINK,
linkify=True
)
status = columns.ChoiceFieldColumn()
site = tables.Column(
Expand Down Expand Up @@ -897,7 +899,8 @@ class VirtualDeviceContextTable(TenancyColumnsMixin, NetBoxTable):
)
device = tables.TemplateColumn(
order_by=('_name',),
template_code=DEVICE_LINK
template_code=DEVICE_LINK,
linkify=True
)
status = columns.ChoiceFieldColumn()
primary_ip = tables.Column(
Expand Down
4 changes: 1 addition & 3 deletions netbox/dcim/tables/template_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
"""

DEVICE_LINK = """
<a href="{% url 'dcim:device' pk=record.pk %}">
{{ record.name|default:'<span class="badge bg-info">Unnamed device</span>' }}
</a>
{{ value|default:'<span class="badge bg-info">Unnamed device</span>' }}
"""

DEVICEBAY_STATUS = """
Expand Down

0 comments on commit 9774bb4

Please sign in to comment.