From 58e4d08bb0b6622caf7cbcb2d6171d6200baeb44 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 30 Mar 2022 15:51:12 -0400 Subject: [PATCH 1/4] Closes #8790: Include site and prefixes columns in VLAN group VLANs table --- docs/release-notes/version-3.1.md | 1 + netbox/ipam/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 5092d18ed..7e8e93632 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -6,6 +6,7 @@ * [#8163](https://github.com/netbox-community/netbox/issues/8163) - Show bridge interface members under interface view * [#8785](https://github.com/netbox-community/netbox/issues/8785) - Permit wildcard values in IP address DNS names +* [#8790](https://github.com/netbox-community/netbox/issues/8790) - Include site and prefixes columns in VLAN group VLANs table * [#8830](https://github.com/netbox-community/netbox/issues/8830) - Add Checkpoint ClusterXL protocol for FHRP groups * [#8974](https://github.com/netbox-community/netbox/issues/8974) - Use monospace font for text areas in config revision form diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index aab9a6249..e32cf4d96 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -795,7 +795,7 @@ class VLANGroupView(generic.ObjectView): vlans_count = vlans.count() vlans = add_available_vlans(vlans, vlan_group=instance) - vlans_table = tables.VLANTable(vlans, exclude=('site', 'group', 'prefixes')) + vlans_table = tables.VLANTable(vlans, exclude=('group',)) if request.user.has_perm('ipam.change_vlan') or request.user.has_perm('ipam.delete_vlan'): vlans_table.columns.show('pk') paginate_table(vlans_table, request) From a84ae88214b88a81af9ed96e9022d6e5a837f969 Mon Sep 17 00:00:00 2001 From: kkthxbye <> Date: Fri, 1 Apr 2022 09:34:16 +0200 Subject: [PATCH 2/4] Annotate rack search queryset with device count --- netbox/netbox/constants.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/netbox/constants.py b/netbox/netbox/constants.py index 45de4d5b2..bc58ee5e4 100644 --- a/netbox/netbox/constants.py +++ b/netbox/netbox/constants.py @@ -65,7 +65,9 @@ DCIM_TYPES = OrderedDict( 'url': 'dcim:site_list', }), ('rack', { - 'queryset': Rack.objects.prefetch_related('site', 'location', 'tenant', 'role'), + 'queryset': Rack.objects.prefetch_related('site', 'location', 'tenant', 'role').annotate( + device_count=count_related(Device, 'rack') + ), 'filterset': RackFilterSet, 'table': RackTable, 'url': 'dcim:rack_list', From 35f3a42e7f8d6eb82448d73f25145a7a7f335de2 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 1 Apr 2022 08:31:53 -0400 Subject: [PATCH 3/4] Remove 2022 survey announcement --- README.md | 2 -- docs/index.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/README.md b/README.md index 42bf8b619..8429cd4b3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ NetBox logo -:loudspeaker: The **[2022 NetBox community survey](https://forms.gle/KR8YbR8GiJ9EYXM28)** is now open! We collect this feedback and demographic data from NetBox users around the world to help shape the project's long-term development goals. Please take a few minutes to share your responses! - ![Master branch build status](https://github.com/netbox-community/netbox/workflows/CI/badge.svg?branch=master) NetBox is an infrastructure resource modeling (IRM) tool designed to empower diff --git a/docs/index.md b/docs/index.md index 5742c0ab6..943f1d7ab 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,5 @@ ![NetBox](netbox_logo.svg "NetBox logo"){style="height: 100px; margin-bottom: 3em"} -:loudspeaker: The **[2022 NetBox community survey](https://forms.gle/KR8YbR8GiJ9EYXM28)** is now open! We collect this feedback and demographic data from NetBox users around the world to help shape the project's long-term development goals. Please take a few minutes to share your responses! - # What is NetBox? NetBox is an infrastructure resource modeling (IRM) application designed to empower network automation. Initially conceived by the network engineering team at [DigitalOcean](https://www.digitalocean.com/), NetBox was developed specifically to address the needs of network and infrastructure engineers. NetBox is made available as open source under the Apache 2 license. It encompasses the following aspects of network management: From 99a01207bcf3202d04986862398d3934bb5e912a Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 1 Apr 2022 09:06:44 -0400 Subject: [PATCH 4/4] Closes #9012: Linkify circuits count in providers list --- docs/release-notes/version-3.1.md | 2 ++ netbox/circuits/tables.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 7e8e93632..bab66f2ad 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -9,10 +9,12 @@ * [#8790](https://github.com/netbox-community/netbox/issues/8790) - Include site and prefixes columns in VLAN group VLANs table * [#8830](https://github.com/netbox-community/netbox/issues/8830) - Add Checkpoint ClusterXL protocol for FHRP groups * [#8974](https://github.com/netbox-community/netbox/issues/8974) - Use monospace font for text areas in config revision form +* [#9012](https://github.com/netbox-community/netbox/issues/9012) - Linkify circuits count in providers list ### Bug Fixes * [#8866](https://github.com/netbox-community/netbox/issues/8866) - Prevent exception when searching for a rack position with no rack specified under device edit view +* [#9009](https://github.com/netbox-community/netbox/issues/9009) - Fix device count for racks in global search results --- diff --git a/netbox/circuits/tables.py b/netbox/circuits/tables.py index b4e0c7d2d..76fb96aaf 100644 --- a/netbox/circuits/tables.py +++ b/netbox/circuits/tables.py @@ -2,7 +2,9 @@ import django_tables2 as tables from django_tables2.utils import Accessor from tenancy.tables import TenantColumn -from utilities.tables import BaseTable, ButtonsColumn, ChoiceFieldColumn, MarkdownColumn, TagColumn, ToggleColumn +from utilities.tables import ( + BaseTable, ButtonsColumn, ChoiceFieldColumn, LinkedCountColumn, MarkdownColumn, TagColumn, ToggleColumn, +) from .models import * @@ -53,8 +55,10 @@ class ProviderTable(BaseTable): name = tables.Column( linkify=True ) - circuit_count = tables.Column( + circuit_count = LinkedCountColumn( accessor=Accessor('count_circuits'), + viewname='circuits:circuit_list', + url_params={'provider_id': 'pk'}, verbose_name='Circuits' ) comments = MarkdownColumn()