Commit Graph

51 Commits

Author SHA1 Message Date
Jeremy Stretch
b4f15092db
Closes #5858: Implement a quick-add UI widget for related objects (#18016)
* WIP

* Misc cleanup

* Add warning re: nested quick-adds
2024-11-18 14:44:57 -05:00
Arthur Hanson
9fe6685562
17929 Add Scope Mixins to Prefix (#17930)
* 17929 Add Scope Mixins to Prefix

* 17929 Add Scope Mixins to Prefix

* 17929 fixes for tests

* 17929 merge latest scope changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 17929 fix migrations
2024-11-15 14:55:46 -05:00
Jeremy Stretch
8767fd8186
Closes #13428: Q-in-Q VLANs (#17822)
* Initial work on #13428 (QinQ)

* Misc cleanup; add tests for Q-in-Q fields

* Address PR feedback
2024-10-31 14:17:06 -04:00
bctiemann
f74a9a1c76
Fixes: #7336 - VLAN Translation (#17745)
* VLANTranslationPolicy and VLANTranslationRule models and all associated UI classes

* Change VLANTranslationPolicy to a PrimaryModel and make name unique

* Add serializer classes to InterfaceSerializer

* Remake migrations

* Add GraphQL typing

* Skip tagged models in test

* Missing migration

* Remove get_absolute_url methods

* Remove package-lock.json

* Rebuild migration and add constraints and field options

* Rebuild migrations

* Use DynamicModelChoiceField for policy field

* Make vlan_translation_policy fields on filtersets more consistent with existing __name convention

* Add vlan_translation_table to VMInterface detail page

* Add vlan_translation_policy to VMInterfaceSerializer

* Move vlan_translation_policy fields to model and filterset mixins

* Protect in-use policies against deletion

* Add vlan_translation_policy to fields in VMInterfaceSerializer

* Cleanup indentation

* Remove unnecessary ordering column

* Rebuild migrations

* Search methods and registration

* Ensure 'id' column is present by default

* Add graphql types/filters/schema for VLANTranslationRule

* Filterset tests

* View tests

* API and viewset tests (incomplete)

* Add tags to VLANTranslationRuleForm

* Complete viewset tests for VLANTranslationRule

* Make VLANTranslationRule.policy nullable (but still required)

* Revert "Make VLANTranslationRule.policy nullable (but still required)"

This reverts commit 4c1bb437ef.

* Revert nullability

* Explicitly prefetch policy in graphql

* Documentation of new and affected models

* Add note about select_related in graphql

* Rework policy/rule documentation

* Move vlan_translation_policy into 802.1Q Switching fieldset

* Remove redundant InterfaceVLANTranslationTable

* Conditionally include vlan_translation_table in interface.html and vminterface.html

* Add description field to VLANTranslationRule

* Define vlan_translation_table conditionally

* Add policy (name) filter to VLANTranslationRuleFilterSet

* Revert changes to adding-models.md (moved to another PR)

* Dynamic table for linked rules in vlantranslationpolicy.html

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-10-30 17:09:46 -04:00
Jeremy Stretch
75270c1aef
Closes #6414: Enable assigning prefixes to various object types (#17692)
* Replace site FK on Prefix with scope GFK

* Add denormalized relations

* Update prefix filters

* Add generic relations for Prefix

* Update GraphQL type for Prefix model

* Fix tests; misc cleanup

* Remove prefix_count from SiteSerializer

* Remove site field from PrefixBulkEditForm

* Restore scope filters for prefixes

* Fix scope population on PrefixForm init

* Show scope type

* Assign scope during bulk import of prefixes

* Correct handling of GenericForeignKey in PrefixForm

* Add prefix counts to all scoped objects

* Fix migration; linter fix

* Add limit_choices_to on scope_type

* Clean up cache_related_objects()

* Enable bulk editing prefix scope
2024-10-18 15:45:22 -04:00
Arthur Hanson
3f469b0b0a
17476 Upgrade to Django 5.1 (#17620)
* 17476 Upgrade to Django 5.1

* 16136 fix migrations

* 17476 update remove GFK from fields

* 17476 fix

* 17476 update django to bugfix release

* fix comma
2024-10-10 09:08:58 -04:00
Jeremy Stretch
6f7bf5baf4 Merge branch 'develop' into feature 2024-08-29 10:51:38 -04:00
Jeremy Stretch
c2d67fa17e
Closes #17256: Fix translation support in VLAN group scope assignment form (#17270)
* Closes #17256: Fix translation support in VLAN group scope assignment form

* Disable scope field if scope type not selected; update label on type change

* Reset selected scope object when changing scope type
2024-08-27 13:58:56 -04:00
Arthur Hanson
cf1024a12b
9627 use ArrayField on VLANGroup for allowed VLANs (#16710)
* 9627 initial commit

* 9627 numeric range field

* 9627 numeric range field

* 9627 numeric range field

* 9627 numeric range field

* 9627 add stuff for utilization calc

* 9627 update views

* 9627 fixes

* 9627 available_vlans

* 9627 available_vlans

* 9627 fixes

* 9627 bulk import / edit

* 9627 test fixes

* 9627 test fixes

* 9627 update validation

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 review changes

* 9627 temp vlan_id filter

* Clean up labels

* Remove annotate_vlan_ranges() from VLANGroupQuerySet

* Misc cleanup

* Implement contains_vid filter

* Serialize VID ranges as integer lists in REST API

* Remove default value from vlan_id_ranges

* 9627 fix typo in test

* Require vlan_id_ranges & set default value

* Fix logic for upper range boundaries

* Add field to VLANGroup model documentation

* Rename vlan_id_ranges to vid_ranges

* Fix computation of available VLAN IDs

* Clean up migration

* Add tests for range utility functions

* Clean up add_available_vlans()

* Misc cleanup, add test for VID validation

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-16 10:47:18 -04:00
Jeremy Stretch
0b7804c01c Fixes #13293: Limit interface selector for IP address to current device/VM 2024-05-14 14:48:47 -04:00
Jeremy Stretch
46bd62fdc9 Merge branch 'develop' into feature 2024-04-22 13:23:42 -04:00
Arthur
fca23c6419 15029 check if duplicate FHRP group assignment 2024-04-03 14:09:32 -04:00
Jeremy Stretch
72d3c17b48 Use FieldSet instances for all forms 2024-03-19 13:34:13 -04:00
Jeremy Stretch
3b28e8e615 Refactor form rendering components & add docstrings 2024-03-19 13:34:13 -04:00
Jeremy Stretch
2aaa552067 Replace custom form templates with TabbedFieldGroups 2024-03-19 13:34:13 -04:00
Jeremy Stretch
8f03a19b5f Introduce ObjectAttribute for displaying read-only instance attributes on forms 2024-03-19 13:34:13 -04:00
Jeremy Stretch
78bd7dec48 Merge branch 'develop' into feature 2024-03-15 12:32:54 -04:00
Jeremy Stretch
bdcf4c4154 Fixes #15220: Move IP mask validation logic from form to model 2024-03-01 11:28:48 -05:00
Jeremy Stretch
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
Arthur Hanson
af27bf5eff
15094 Add missing gettext to error strings for internationalization (#15155)
* 15049 add missing gettext to error strings

* 15049 add missing gettext to error strings

* 15094 review change

* 15094 review change

* Formatting cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:44:02 -05:00
Jeremy Stretch
20824ceb25
Closes #13283: Add context to dropdown options (#15104)
* Initial work on #13283

* Enable passing TomSelect HTML template attibutes on DynamicModelChoiceField

* Merge disabled_indicator into option_attrs

* Add support for annotating a numeric count on dropdown options

* Annotate parent object on relevant fields

* Improve rendering of color options

* Improve rendering of color options

* Rename option_attrs to context

* Expose option context on ObjectVar for custom scripts

* Document dropdown context variables
2024-02-13 16:31:17 -05:00
Jeremy Stretch
74e67afa41 Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
Jeremy Stretch
da085e60c2
Closes #14740: Remove BootstrapMixin (#14841)
* Introduce custom form widget templates to apply CSS classes

* Apply both mandatory and optional CSS classes to form widgets

* Omit required & placeholder attrs

* Move annotation of field validation failures to CSS

* Remove BootstrapMixin class

* Remove obsolete ComponentTemplateImportForm class

* Remove obsolete custom forms for login & password change

* Clean up obsolete accommodations for 'required' widget attr
2024-01-19 14:02:33 -05:00
Daniel Sheppard
bb806e21f7 Fixes: #13844 - Change site filter to use available_at_site instead of site_id 2024-01-16 11:28:46 -05:00
Jeremy Stretch
d2fea4edc4
Closes #14311: Move L2VPN models from ipam to vpn (#14358)
* Move L2VPN and L2VPNTermination models from ipam to vpn

* Move L2VPN resources from ipam to vpn

* Extend migration to update content types

* Misc cleanup
2023-11-28 13:45:00 -05:00
Jeremy Stretch
c4e765c4a8
Closes #14141: translation cleanup (#14143)
* Translations cleanup

* Tweak variable names; misc string cleanup

* Misc cleanup
2023-10-30 13:38:03 -04:00
Arthur
685ac5f571 13891 fix primary ip assignment if assigning ip 2023-09-26 08:56:35 -04:00
Jeremy Stretch
2dfbd72f10 Fixes #13767: Fix support for comments when creating a new service via web UI 2023-09-15 10:33:54 -04:00
Jeremy Stretch
b5125e512f Fixes #13721: Filter VLAN choices by selected site (if any) when creating a prefix 2023-09-11 13:52:19 -04:00
Arthur Hanson
b7a9649269
Closes #13149: Wrap form field labels with gettext_lazy()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 12:52:38 -04:00
Abhimanyu Saharan
16ee42ac38 fixes prechange snapshot #12617 2023-07-06 09:39:09 -04:00
Abhimanyu Saharan
27e850a68d fix ip address assignment #12953 2023-06-23 14:39:16 -04:00
Dillon Henschen
0e873a01b8
Closes #12622: Fix assigning VLAN without site to Prefix (#12784)
* Issue #12622: Fix creating Prefix using VLAN without site

* Issue #12622: Fix importing Prefix using VLAN without site

This commit also adds tests to verify the import changes implemented
in this commit.

* Issue #12622: Cleanup code to filter allowed VLANs on a prefix import

* Closes #12622: Switch to VLAN selector dialog when creating Prefix
2023-06-14 13:49:00 -04:00
Jamie Murphy
22a0ce3f76 broadcast error fixes for ipv6 and /31/32 2023-06-12 21:01:43 +01:00
jeremystretch
b64b19a3f4 Fixes #11934: Prevent reassignment of an IP address designated as primary for its parent object 2023-05-25 16:42:24 -04:00
Austin de Coup-Crank
005e3fd692
Closes #9068: validate addresses assigned to interfaces (#12618)
* Begin logic

* Closes #9068: Disallow assigning bcast/networks to interfaces

* Allow net IDs in /31, /32, /127, /128

* linting error

* Implement requested changes

* Condensed the "if" logic a bit

---------

Co-authored-by: Austin de Coup-Crank <decoupca@moodys.com>
Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-05-22 16:16:17 -04:00
Daniel Sheppard
46914d9479
Fixes: #10757 - Change IP interface assignment to use new selector (#12452)
* Fixes: #10757 - Change interface assignment to use new selector.  Perform the same change to the NAT assignment as well.

* Remove nat_vrf from form and remove query_params that are not required anymore
2023-05-04 13:59:28 -04:00
Jeremy Stretch
d470848b29
Closes #12246: General cleanup of utilities modules
* Clean up base modules

* Clean up forms modules

* Clean up templatetags modules

* Replace custom simplify_decimal filter with floatformat

* Misc cleanup

* Merge ReturnURLForm into ConfirmationForm

* Clean up import statements for utilities.forms

* Fix field class references in docs
2023-04-14 10:33:53 -04:00
Jeremy Stretch
d1f76bec37
Closes #10054: Implement advanced UI controls for object selection (#11952)
* WIP

* WIP

* WIP

* Make object selector functional

* Replace extraneous form fields with selector widgets

* Avoid overlap with filterset field names

* Show checkmarks next to visibile filters

* Update results automatically when searching

* Include selector for device/VM component parent fields

* Use selector for filtering VLAN group/site

* Limit selector to 100 results
2023-03-13 12:44:26 -04:00
jeremystretch
2a9178af12 Merge branch 'develop' into feature 2023-03-13 11:58:37 -04:00
jeremystretch
c44eb65993 Closes #11325: Move help_texts from model forms to models 2023-03-01 17:31:54 -05:00
jeremystretch
536b46158a Add mark_utilized to IPRange 2023-03-01 09:27:06 -05:00
Jeremy Stretch
7994073687
Closes #8550: Implement ASN ranges (#11835)
* Move ASN to a separate module

* Move ASNField from dcim to ipam

* Introduce ASNRange model

* Add relationship from ASN to ASNRange

* Add an available-asns API endpoint

* Add RIR assignment for ASNRange

* Add standard tests

* Move child ASNs to a tabbed view

* Remove FK on ASN to ASNRange

* Add tests for provisioning available ASNs

* Add docs for ASNRange
2023-02-27 16:36:05 -05:00
Simon Toft
559a318584 Fixes #11565 - Populate custom field defaults when creating FHRP groups with VIP 2023-02-27 14:02:22 -05:00
Jeremy Stretch
b9bd96f0c7 Closes #11765: Remove StaticSelect & StaticSelectMultiple (#11767)
* Remove StaticSelect, StaticSelectMultiple form widgets

* Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
2023-02-19 20:09:51 -05:00
jeremystretch
c3dcd8937f Merge branch 'develop' into feature 2022-11-22 10:08:23 -05:00
jeremystretch
2f96fdd135 Merge branch 'develop' into feature 2022-11-16 11:42:32 -05:00
Arthur
6eba5d4d96 10300 initial translation support use gettext 2022-11-11 08:47:29 -05:00
Jeremy Stretch
bc6b5bc4be
Closes #10545: Standardize description & comment fields on primary models (#10834)
* Standardize description & comments fields on primary models

* Update REST API serializers

* Update forms

* Update tables

* Update templates
2022-11-04 08:28:09 -04:00
jeremystretch
c4dcd34ce9 Merge branch 'develop' into feature 2022-10-26 10:25:49 -04:00