Просмотр исходного кода

Closes #6275: Linkify rack, device counts on locations list

jeremystretch 4 лет назад
Родитель
Сommit
19a2b9042f
2 измененных файлов с 10 добавлено и 2 удалено
  1. 4 0
      docs/release-notes/version-2.11.md
  2. 6 2
      netbox/dcim/tables/sites.py

+ 4 - 0
docs/release-notes/version-2.11.md

@@ -2,6 +2,10 @@
 
 ## v2.11.2 (FUTURE)
 
+### Enhancements
+
+* [#6275](https://github.com/netbox-community/netbox/issues/6275) - Linkify rack, device counts on locations list
+
 ### Bug Fixes
 
 * [#6236](https://github.com/netbox-community/netbox/issues/6236) - Journal entry title should account for configured timezone

+ 6 - 2
netbox/dcim/tables/sites.py

@@ -102,10 +102,14 @@ class LocationTable(BaseTable):
     site = tables.Column(
         linkify=True
     )
-    rack_count = tables.Column(
+    rack_count = LinkedCountColumn(
+        viewname='dcim:rack_list',
+        url_params={'location_id': 'pk'},
         verbose_name='Racks'
     )
-    device_count = tables.Column(
+    device_count = LinkedCountColumn(
+        viewname='dcim:device_list',
+        url_params={'location_id': 'pk'},
         verbose_name='Devices'
     )
     actions = ButtonsColumn(