From aa5c42683a7c368cbe842f74a86e0916609c8c97 Mon Sep 17 00:00:00 2001 From: PieterL75 <74899468+PieterL75@users.noreply.github.com> Date: Mon, 18 Oct 2021 16:12:23 +0200 Subject: [PATCH 1/7] Fix #7556 : NewVersion showing url --- netbox/netbox/views/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/netbox/views/__init__.py b/netbox/netbox/views/__init__.py index 3568204fe..2c033e760 100644 --- a/netbox/netbox/views/__init__.py +++ b/netbox/netbox/views/__init__.py @@ -137,7 +137,7 @@ class HomeView(View): release_version, release_url = latest_release if release_version > version.parse(settings.VERSION): new_release = { - 'version': str(latest_release), + 'version': str(release_version), 'url': release_url, } From 79cee12b1eac59e07145925c75d4d8f355cebe4e Mon Sep 17 00:00:00 2001 From: PieterL75 <74899468+PieterL75@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:23:05 +0200 Subject: [PATCH 2/7] Updated release notes with #7556 --- docs/release-notes/version-3.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 70a9a0dac..8b0e99b4f 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -10,6 +10,7 @@ * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects * [#7545](https://github.com/netbox-community/netbox/issues/7545) - Fix incorrect display of update/delete events for webhooks +* [#7556](https://github.com/netbox-community/netbox/issues/7556) - Fix display of New Version --- From c1720505f36eeb0f247da32549a68fcd61e8ef96 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:22:22 -0400 Subject: [PATCH 3/7] Fixes #7584: Fix alignment of object identifier under object view --- docs/release-notes/version-3.0.md | 3 ++- netbox/templates/generic/object.html | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 8b0e99b4f..77da55606 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -10,7 +10,8 @@ * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects * [#7545](https://github.com/netbox-community/netbox/issues/7545) - Fix incorrect display of update/delete events for webhooks -* [#7556](https://github.com/netbox-community/netbox/issues/7556) - Fix display of New Version +* [#7556](https://github.com/netbox-community/netbox/issues/7556) - Fix display of version when new release is available +* [#7584](https://github.com/netbox-community/netbox/issues/7584) - Fix alignment of object identifier under object view --- diff --git a/netbox/templates/generic/object.html b/netbox/templates/generic/object.html index 24285846f..40c0e09ce 100644 --- a/netbox/templates/generic/object.html +++ b/netbox/templates/generic/object.html @@ -6,9 +6,17 @@ {% load plugins %} {% block header %} - {# Breadcrumbs #} - + {{ block.super }} {% endblock %} From 96015aa59031bbbb96b1ef634c684c52d0ac2e83 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:31:07 -0400 Subject: [PATCH 4/7] Fixes #7582: Fix rendering of CustomLink context data table --- docs/customization/custom-links.md | 1 - mkdocs.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 docs/customization/custom-links.md diff --git a/docs/customization/custom-links.md b/docs/customization/custom-links.md deleted file mode 100644 index 1ee366cfd..000000000 --- a/docs/customization/custom-links.md +++ /dev/null @@ -1 +0,0 @@ -{!models/extras/customlink.md!} diff --git a/mkdocs.yml b/mkdocs.yml index 7244c36d6..d12ef734f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,7 +65,7 @@ nav: - Customization: - Custom Fields: 'customization/custom-fields.md' - Custom Validation: 'customization/custom-validation.md' - - Custom Links: 'customization/custom-links.md' + - Custom Links: 'models/extras/customlink.md' - Export Templates: 'customization/export-templates.md' - Custom Scripts: 'customization/custom-scripts.md' - Reports: 'customization/reports.md' From 39430e01de814ef21ea7dc71f6f84cc3776e771f Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:41:19 -0400 Subject: [PATCH 5/7] Fixes #7550: Fix rendering of UTF8-encoded data in change records --- docs/release-notes/version-3.0.md | 1 + netbox/templates/extras/objectchange.html | 10 +++++----- netbox/utilities/templatetags/helpers.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 77da55606..9497f1c7a 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -10,6 +10,7 @@ * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects * [#7545](https://github.com/netbox-community/netbox/issues/7545) - Fix incorrect display of update/delete events for webhooks +* [#7550](https://github.com/netbox-community/netbox/issues/7550) - Fix rendering of UTF8-encoded data in change records * [#7556](https://github.com/netbox-community/netbox/issues/7556) - Fix display of version when new release is available * [#7584](https://github.com/netbox-community/netbox/issues/7584) - Fix alignment of object identifier under object view diff --git a/netbox/templates/extras/objectchange.html b/netbox/templates/extras/objectchange.html index b7bc12446..e8d72810e 100644 --- a/netbox/templates/extras/objectchange.html +++ b/netbox/templates/extras/objectchange.html @@ -130,12 +130,12 @@
{% if object.postchange_data %} -
{% for k, v in object.postchange_data.items %}{% spaceless %}
-                    {{ k }}: {{ v|render_json }}
-                    {% endspaceless %}{% endfor %}
-                
+
{% for k, v in object.postchange_data.items %}{% spaceless %}
+                        {{ k }}: {{ v|render_json }}
+                        {% endspaceless %}{% endfor %}
+                    
{% else %} - None + None {% endif %}
diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index a900d59e2..1695c8257 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -58,7 +58,7 @@ def render_json(value): """ Render a dictionary as formatted JSON. """ - return json.dumps(value, indent=4, sort_keys=True) + return json.dumps(value, ensure_ascii=False, indent=4, sort_keys=True) @register.filter() From eb4b4a6c8d238530e51df7455a179e404404ab90 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:51:39 -0400 Subject: [PATCH 6/7] Closes #7561: Add a utilization column to the IP ranges table --- docs/release-notes/version-3.0.md | 4 ++++ netbox/ipam/tables/ip.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 9497f1c7a..f27a23f2c 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -2,6 +2,10 @@ ## v3.0.8 (FUTURE) +### Enhancements + +* [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table + ### Bug Fixes * [#7300](https://github.com/netbox-community/netbox/issues/7300) - Fix incorrect Device LLDP interface row coloring diff --git a/netbox/ipam/tables/ip.py b/netbox/ipam/tables/ip.py index 485e4a123..ddad6c573 100644 --- a/netbox/ipam/tables/ip.py +++ b/netbox/ipam/tables/ip.py @@ -260,11 +260,16 @@ class IPRangeTable(BaseTable): linkify=True ) tenant = TenantColumn() + utilization = UtilizationColumn( + accessor='utilization', + orderable=False + ) class Meta(BaseTable.Meta): model = IPRange fields = ( 'pk', 'start_address', 'end_address', 'size', 'vrf', 'status', 'role', 'tenant', 'description', + 'utilization', ) default_columns = ( 'pk', 'start_address', 'end_address', 'size', 'vrf', 'status', 'role', 'tenant', 'description', From 73f2f9fc6375e7a6d97d5a776dcb7775eec9006e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:57:02 -0400 Subject: [PATCH 7/7] Closes #7551: Add UI field to filter interfaces by kind --- docs/release-notes/version-3.0.md | 1 + netbox/dcim/choices.py | 12 ++++++++++++ netbox/dcim/forms/filtersets.py | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index f27a23f2c..d50c511b5 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,6 +4,7 @@ ### Enhancements +* [#7551](https://github.com/netbox-community/netbox/issues/7551) - Add UI field to filter interfaces by kind * [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table ### Bug Fixes diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py index acea294f8..2f6228751 100644 --- a/netbox/dcim/choices.py +++ b/netbox/dcim/choices.py @@ -685,6 +685,18 @@ class PowerOutletFeedLegChoices(ChoiceSet): # Interfaces # +class InterfaceKindChoices(ChoiceSet): + KIND_PHYSICAL = 'physical' + KIND_VIRTUAL = 'virtual' + KIND_WIRELESS = 'wireless' + + CHOICES = ( + (KIND_PHYSICAL, 'Physical'), + (KIND_VIRTUAL, 'Virtual'), + (KIND_WIRELESS, 'Wireless'), + ) + + class InterfaceTypeChoices(ChoiceSet): # Virtual diff --git a/netbox/dcim/forms/filtersets.py b/netbox/dcim/forms/filtersets.py index 95ff9aa3d..4ef53c469 100644 --- a/netbox/dcim/forms/filtersets.py +++ b/netbox/dcim/forms/filtersets.py @@ -957,9 +957,14 @@ class InterfaceFilterForm(DeviceComponentFilterForm): model = Interface field_groups = [ ['q', 'tag'], - ['name', 'label', 'type', 'enabled', 'mgmt_only', 'mac_address'], + ['name', 'label', 'kind', 'type', 'enabled', 'mgmt_only', 'mac_address'], ['region_id', 'site_group_id', 'site_id', 'location_id', 'device_id'], ] + kind = forms.MultipleChoiceField( + choices=InterfaceKindChoices, + required=False, + widget=StaticSelectMultiple() + ) type = forms.MultipleChoiceField( choices=InterfaceTypeChoices, required=False,