Skip to content

Commit 85f9690

Browse files
committed
Closes #8083: Removed "related devices" panel from device view
1 parent 4723500 commit 85f9690

File tree

3 files changed

+7
-49
lines changed

3 files changed

+7
-49
lines changed

docs/release-notes/version-3.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [#8057](https://github.com/netbox-community/netbox/issues/8057) - Dynamic object tables using HTMX
99
* [#8080](https://github.com/netbox-community/netbox/issues/8080) - Link to NAT IPs for device/VM primary IPs
1010
* [#8081](https://github.com/netbox-community/netbox/issues/8081) - Allow creating services directly from navigation menu
11+
* [#8083](https://github.com/netbox-community/netbox/issues/8083) - Removed "related devices" panel from device view
1112
* [#8108](https://github.com/netbox-community/netbox/issues/8108) - Improve breadcrumb links for device/VM components
1213

1314
### Bug Fixes

netbox/dcim/views.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,19 +1316,9 @@ def get_extra_context(self, request, instance):
13161316
# Services
13171317
services = Service.objects.restrict(request.user, 'view').filter(device=instance)
13181318

1319-
# Find up to ten devices in the same site with the same functional role for quick reference.
1320-
related_devices = Device.objects.restrict(request.user, 'view').filter(
1321-
site=instance.site, device_role=instance.device_role
1322-
).exclude(
1323-
pk=instance.pk
1324-
).prefetch_related(
1325-
'rack', 'device_type__manufacturer'
1326-
)[:10]
1327-
13281319
return {
13291320
'services': services,
13301321
'vc_members': vc_members,
1331-
'related_devices': related_devices,
13321322
'active_tab': 'device',
13331323
}
13341324

netbox/templates/dcim/device.html

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ <h5 class="card-header">
148148
</div>
149149
</div>
150150
{% endif %}
151+
{% include 'inc/panels/custom_fields.html' %}
152+
{% include 'inc/panels/tags.html' %}
153+
{% include 'inc/panels/comments.html' %}
154+
{% plugin_left_page object %}
155+
</div>
156+
<div class="col col-md-6">
151157
<div class="card">
152158
<h5 class="card-header">
153159
Management
@@ -220,12 +226,6 @@ <h5 class="card-header">
220226
</table>
221227
</div>
222228
</div>
223-
{% include 'inc/panels/custom_fields.html' %}
224-
{% include 'inc/panels/tags.html' %}
225-
{% include 'inc/panels/comments.html' %}
226-
{% plugin_left_page object %}
227-
</div>
228-
<div class="col col-md-6">
229229
{% if object.powerports.exists and object.poweroutlets.exists %}
230230
<div class="card">
231231
<h5 class="card-header">
@@ -298,39 +298,6 @@ <h5 class="card-header">
298298
</div>
299299
{% include 'inc/panels/contacts.html' %}
300300
{% include 'inc/panels/image_attachments.html' %}
301-
<div class="card noprint">
302-
<h5 class="card-header">
303-
Related Devices
304-
</h5>
305-
<div class="card-body">
306-
{% if related_devices %}
307-
<table class="table table-hover">
308-
<tr>
309-
<th>Device</th>
310-
<th>Rack</th>
311-
<th>Type</th>
312-
</tr>
313-
{% for rd in related_devices %}
314-
<tr>
315-
<td>
316-
<a href="{% url 'dcim:device' pk=rd.pk %}">{{ rd }}</a>
317-
</td>
318-
<td>
319-
{% if rd.rack %}
320-
<a href="{% url 'dcim:rack' pk=rd.rack.pk %}">{{ rd.rack }}</a>
321-
{% else %}
322-
<span class="text-muted">&mdash;</span>
323-
{% endif %}
324-
</td>
325-
<td>{{ rd.device_type }}</td>
326-
</tr>
327-
{% endfor %}
328-
</table>
329-
{% else %}
330-
<div class="text-muted">None</div>
331-
{% endif %}
332-
</div>
333-
</div>
334301
{% plugin_right_page object %}
335302
</div>
336303
</div>

0 commit comments

Comments
 (0)