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

Merge branch 'develop' into 10170-changelog

Arthur 3 лет назад
Родитель
Сommit
23fafe1996

+ 6 - 4
.github/PULL_REQUEST_TEMPLATE.md

@@ -1,13 +1,15 @@
 <!--
 <!--
     Thank you for your interest in contributing to NetBox! Please note
     Thank you for your interest in contributing to NetBox! Please note
     that our contribution policy requires that a feature request or bug
     that our contribution policy requires that a feature request or bug
-    report be opened for approval prior to filing a pull request. This
+    report be approved and assigned prior to filing a pull request. This
     helps avoid wasting time and effort on something that we might not
     helps avoid wasting time and effort on something that we might not
     be able to accept.
     be able to accept.
 
 
-    Please indicate the relevant feature request or bug report below.
-    IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR
-    FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED.
+    Please indicate the assigned feature request or bug report below.
+    IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED
+    TO YOU, IT WE BE CLOSED AUTOMATICALLY. For example:
+
+    ### Fixes: #1234
 -->
 -->
 ### Fixes: <ISSUE NUMBER GOES HERE>
 ### Fixes: <ISSUE NUMBER GOES HERE>
 <!--
 <!--

+ 18 - 11
CONTRIBUTING.md

@@ -102,23 +102,28 @@ appropriate labels will be applied for categorization.
 [getting started](https://docs.netbox.dev/en/stable/development/getting-started/)
 [getting started](https://docs.netbox.dev/en/stable/development/getting-started/)
 documentation for tips on setting up your development environment.
 documentation for tips on setting up your development environment.
 
 
-* Be sure to open an issue **before** starting work on a pull request, and
-discuss your idea with the NetBox maintainers before beginning work. This will
-help prevent wasting time on something that might we might not be able to
-implement. When suggesting a new feature, also make sure it won't conflict with
-any work that's already in progress.
+* Be sure to open an issue and wait for it to be assigned to you **before**
+starting work on a pull request, and discuss your idea with the NetBox
+maintainers before beginning work. This will help prevent wasting time on
+proposed changes that we might not be able to accept. When suggesting a new
+feature, also make sure it won't conflict with any work that's already in
+progress.
 
 
 * Once you've opened or identified an issue you'd like to work on, ask that it
 * Once you've opened or identified an issue you'd like to work on, ask that it
-be assigned to you so that others are aware it's being worked on. A maintainer
-will then mark the issue as "accepted."
+be assigned to you so that others are aware it's being worked on. If it meets
+the acceptance criteria, a maintainer will then mark the issue as "accepted"
+and assign it to you. (Note that GitHub requires that a user first comment on
+an issue before it can be assigned to that user.)
 
 
-* Any pull request which does _not_ relate to an **accepted** issue will be closed.
+* Any pull request which does not relate to an **assigned** issue will be
+closed.
 
 
 * All new functionality must include relevant tests where applicable.
 * All new functionality must include relevant tests where applicable.
 
 
 * When submitting a pull request, please be sure to work off of the `develop`
 * When submitting a pull request, please be sure to work off of the `develop`
 branch, rather than `master`. The `develop` branch is used for ongoing
 branch, rather than `master`. The `develop` branch is used for ongoing
-development, while `master` is used for tagging stable releases.
+development, while `master` is used for tagging stable releases. (If you're
+developing for the next minor release, use `feature` instead.)
 
 
 * In most cases, it is not necessary to add a changelog entry: A maintainer will
 * In most cases, it is not necessary to add a changelog entry: A maintainer will
 take care of this when the PR is merged. (This helps avoid merge conflicts
 take care of this when the PR is merged. (This helps avoid merge conflicts
@@ -136,8 +141,10 @@ these checks):
 
 
 Only comment on an issue if you are sharing a relevant idea or constructive
 Only comment on an issue if you are sharing a relevant idea or constructive
 feedback. **Do not** comment on an issue just to show your support (give the
 feedback. **Do not** comment on an issue just to show your support (give the
-top post a :+1: instead) or ask for an ETA. These comments will be deleted to
-reduce noise in the discussion.
+top post a :+1: instead) or to ask for an update. Doing so generates
+unnecessary noise in the discussion, and is especially annoying for people who
+have subscribed to updates for the issue. Any comments without substance
+relevant to the discussion will be deleted.
 
 
 ## Issue Lifecycle
 ## Issue Lifecycle
 
 

+ 14 - 11
README.md

@@ -4,12 +4,14 @@
 
 
 ![Master branch build status](https://github.com/netbox-community/netbox/workflows/CI/badge.svg?branch=master)
 ![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
-network automation, used by thousands of organizations around the world.
-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. It is intended to
-function as a domain-specific source of truth for network operations.
+NetBox is the leading solution for modeling and documenting modern networks. By
+combining the traditional disciplines of IP address management (IPAM) and
+datacenter infrastructure management (DCIM) with powerful APIs and extensions,
+NetBox provides the ideal "source of truth" to power network automation.
+Available as open source software under the Apache 2.0 license, NetBox is
+employed by thousands of organizations around the world.
+
+![Screenshot of Netbox UI](docs/media/screenshots/netbox-ui.png "NetBox UI")
 
 
 Myriad infrastructure components can be modeled in NetBox, including:
 Myriad infrastructure components can be modeled in NetBox, including:
 
 
@@ -21,6 +23,7 @@ Myriad infrastructure components can be modeled in NetBox, including:
 * Virtual machines and clusters
 * Virtual machines and clusters
 * IP prefixes, ranges, and addresses
 * IP prefixes, ranges, and addresses
 * VRFs and route targets
 * VRFs and route targets
+* L2VPN and overlays
 * FHRP groups (VRRP, HSRP, etc.)
 * FHRP groups (VRRP, HSRP, etc.)
 * AS numbers
 * AS numbers
 * VLANs and scoped VLAN groups
 * VLANs and scoped VLAN groups
@@ -45,11 +48,13 @@ customized and extended through the use of:
 NetBox also features a complete REST API as well as a GraphQL API for easily
 NetBox also features a complete REST API as well as a GraphQL API for easily
 integrating with other tools and systems.
 integrating with other tools and systems.
 
 
+The complete documentation for NetBox can be found at [docs.netbox.dev](https://docs.netbox.dev/).
+A public demo instance is available at [demo.netbox.dev](https://demo.netbox.dev).
+
 NetBox runs as a web application atop the [Django](https://www.djangoproject.com/)
 NetBox runs as a web application atop the [Django](https://www.djangoproject.com/)
 Python framework with a [PostgreSQL](https://www.postgresql.org/) database. For a
 Python framework with a [PostgreSQL](https://www.postgresql.org/) database. For a
-complete list of requirements, see `requirements.txt`. The code is available [on GitHub](https://github.com/netbox-community/netbox).
-
-The complete documentation for NetBox can be found at [docs.netbox.dev](https://docs.netbox.dev/). A public demo instance is available at https://demo.netbox.dev.
+complete list of requirements, see `requirements.txt`. The code is available
+[on GitHub](https://github.com/netbox-community/netbox).
 
 
 <div align="center">
 <div align="center">
   <h4>Thank you to our sponsors!</h4>
   <h4>Thank you to our sponsors!</h4>
@@ -90,8 +95,6 @@ our [contributing guide](CONTRIBUTING.md) prior to beginning any work.
 
 
 ### Screenshots
 ### Screenshots
 
 
-![Screenshot of main page (light mode)](docs/media/screenshots/home-light.png "Main page (light mode)")
-
 ![Screenshot of main page (dark mode)](docs/media/screenshots/home-dark.png "Main page (dark mode)")
 ![Screenshot of main page (dark mode)](docs/media/screenshots/home-dark.png "Main page (dark mode)")
 
 
 ![Screenshot of rack elevation](docs/media/screenshots/rack.png "Rack elevation")
 ![Screenshot of rack elevation](docs/media/screenshots/rack.png "Rack elevation")

+ 2 - 0
docs/index.md

@@ -4,6 +4,8 @@
 
 
 NetBox is the leading solution for modeling and documenting modern networks. By combining the traditional disciplines of IP address management (IPAM) and datacenter infrastructure management (DCIM) with powerful APIs and extensions, NetBox provides the ideal "source of truth" to power network automation. Read on to discover why thousands of organizations worldwide put NetBox at the heart of their infrastructure.
 NetBox is the leading solution for modeling and documenting modern networks. By combining the traditional disciplines of IP address management (IPAM) and datacenter infrastructure management (DCIM) with powerful APIs and extensions, NetBox provides the ideal "source of truth" to power network automation. Read on to discover why thousands of organizations worldwide put NetBox at the heart of their infrastructure.
 
 
+[![NetBox UI](./media/screenshots/netbox-ui.png)](./media/screenshots/netbox-ui.png)
+
 ## :material-server-network: Built for Networks
 ## :material-server-network: Built for Networks
 
 
 Unlike general-purpose CMDBs, NetBox has curated a data model which caters specifically to the needs of network engineers and operators. It delivers a wide assortment of object types carefully crafted to best serve the needs of infrastructure design and documentation. These cover all facets of network technology, from IP address managements to cabling to overlays and more:
 Unlike general-purpose CMDBs, NetBox has curated a data model which caters specifically to the needs of network engineers and operators. It delivers a wide assortment of object types carefully crafted to best serve the needs of infrastructure design and documentation. These cover all facets of network technology, from IP address managements to cabling to overlays and more:

BIN
docs/media/screenshots/home-dark.png


BIN
docs/media/screenshots/home-light.png


BIN
docs/media/screenshots/netbox-ui.png


+ 2 - 2
docs/plugins/development/filtersets.md

@@ -34,12 +34,12 @@ To utilize a filter set in a subclass of one of NetBox's generic views (such as
 ```python
 ```python
 # views.py
 # views.py
 from netbox.views.generic import ObjectListView
 from netbox.views.generic import ObjectListView
-from .filtersets import MyModelFitlerSet
+from .filtersets import MyModelFilterSet
 from .models import MyModel
 from .models import MyModel
 
 
 class MyModelListView(ObjectListView):
 class MyModelListView(ObjectListView):
     queryset = MyModel.objects.all()
     queryset = MyModel.objects.all()
-    filterset = MyModelFitlerSet
+    filterset = MyModelFilterSet
 ```
 ```
 
 
 To enable a filter set on a  REST API endpoint, set the `filterset_class` attribute on the API view:
 To enable a filter set on a  REST API endpoint, set the `filterset_class` attribute on the API view:

+ 3 - 0
docs/release-notes/version-3.3.md

@@ -5,6 +5,9 @@
 ### Bug Fixes
 ### Bug Fixes
 
 
 * [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type 
 * [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type 
+* [#10156](https://github.com/netbox-community/netbox/issues/10156) - Avoid forcing SVG image links to open in a new window
+* [#10161](https://github.com/netbox-community/netbox/issues/10161) - Restore "set null" option for custom fields during bulk edit
+* [#10181](https://github.com/netbox-community/netbox/issues/10181) - Restore MultiPartParser (regression from #10031)
 
 
 ---
 ---
 
 

+ 2 - 2
netbox/dcim/svg/cables.py

@@ -94,7 +94,7 @@ class Connector(Group):
         self.add(cable)
         self.add(cable)
 
 
         # Add link
         # Add link
-        link = Hyperlink(href=url, target='_blank')
+        link = Hyperlink(href=url, target='_parent')
 
 
         # Add text label(s)
         # Add text label(s)
         cursor = start[1]
         cursor = start[1]
@@ -281,7 +281,7 @@ class CableTraceSVG:
         self.cursor += PADDING * 2
         self.cursor += PADDING * 2
 
 
         # Add link
         # Add link
-        link = Hyperlink(href=f'{self.base_url}{wirelesslink.get_absolute_url()}', target='_blank')
+        link = Hyperlink(href=f'{self.base_url}{wirelesslink.get_absolute_url()}', target='_parent')
 
 
         # Add text label(s)
         # Add text label(s)
         for i, label in enumerate(labels):
         for i, label in enumerate(labels):

+ 3 - 6
netbox/dcim/svg/racks.py

@@ -151,7 +151,7 @@ class RackElevationSVG:
         css_extra = ' shaded' if is_shaded else ''
         css_extra = ' shaded' if is_shaded else ''
 
 
         # Create hyperlink element
         # Create hyperlink element
-        link = Hyperlink(href=f'{self.base_url}{device.get_absolute_url()}', target='_blank')
+        link = Hyperlink(href=f'{self.base_url}{device.get_absolute_url()}', target="_parent")
         link.set_desc(description)
         link.set_desc(description)
 
 
         # Add rect element to hyperlink
         # Add rect element to hyperlink
@@ -235,10 +235,7 @@ class RackElevationSVG:
                     self.margin_width,
                     self.margin_width,
                     u_height * self.unit_height
                     u_height * self.unit_height
                 )
                 )
-                link = Hyperlink(
-                    href='{}{}'.format(self.base_url, reservation.get_absolute_url()),
-                    target='_blank'
-                )
+                link = Hyperlink(href=f'{self.base_url}{reservation.get_absolute_url()}', target='_parent')
                 link.set_desc(f'Reservation #{reservation.pk}: {reservation.description}')
                 link.set_desc(f'Reservation #{reservation.pk}: {reservation.description}')
                 link.add(
                 link.add(
                     Rect(coords, size, class_='reservation')
                     Rect(coords, size, class_='reservation')
@@ -268,7 +265,7 @@ class RackElevationSVG:
                 y_offset + self.unit_height / 2
                 y_offset + self.unit_height / 2
             )
             )
 
 
-            link = Hyperlink(href=url_string.format(unit), target='_blank')
+            link = Hyperlink(href=url_string.format(unit), target='_parent')
             link.add(Rect((x_offset, y_offset), (self.unit_width, self.unit_height), class_='slot'))
             link.add(Rect((x_offset, y_offset), (self.unit_width, self.unit_height), class_='slot'))
             link.add(Text('add device', insert=text_coords, class_='add-device'))
             link.add(Text('add device', insert=text_coords, class_='add-device'))
 
 

+ 1 - 0
netbox/netbox/settings.py

@@ -535,6 +535,7 @@ REST_FRAMEWORK = {
     'DEFAULT_PAGINATION_CLASS': 'netbox.api.pagination.OptionalLimitOffsetPagination',
     'DEFAULT_PAGINATION_CLASS': 'netbox.api.pagination.OptionalLimitOffsetPagination',
     'DEFAULT_PARSER_CLASSES': (
     'DEFAULT_PARSER_CLASSES': (
         'rest_framework.parsers.JSONParser',
         'rest_framework.parsers.JSONParser',
+        'rest_framework.parsers.MultiPartParser',
     ),
     ),
     'DEFAULT_PERMISSION_CLASSES': (
     'DEFAULT_PERMISSION_CLASSES': (
         'netbox.api.authentication.TokenPermissions',
         'netbox.api.authentication.TokenPermissions',

+ 5 - 1
netbox/utilities/templates/form_helpers/render_custom_fields.html

@@ -7,6 +7,10 @@
   </div>
   </div>
   {% endif %}
   {% endif %}
   {% for name in fields %}
   {% for name in fields %}
-    {% render_field form|getfield:name %}
+    {% if name in form.nullable_fields %}
+      {% render_field form|getfield:name bulk_nullable=True %}
+    {% else %}
+      {% render_field form|getfield:name %}
+    {% endif %}
   {% endfor %}
   {% endfor %}
 {% endfor %}
 {% endfor %}