* 17754 fix per-page on version history
* 17754 remove htmx table
* Use non-HTMX template for static tables
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Align strawberry resolver with expected return type
* Align test data with expected representation of extra_choices in CustomFieldChoiceSet model
---------
Co-authored-by: Griffin Ellis <griffin.ellis@pico.net>
* Fixes: #17648 - Fix exception thrown in `Job.delete()` when no object_type specified
* Remove unrelated fix
* Change back elif to if
* Remove unused imports
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Fixes: #17566 - Fix issue `Job.get_absolute_url()` to prevent exception being thrown if no object_type is set
* Add back whitespace after statements
* Remove whitespace. Change to if statement
* Only remove extraneous attributes from extra if changing to a BooleanField
* Add tests for MultipleChoiceField icontains and negation
* Use enum in test consistently
* Reorganize tests
* Add __empty test to base filter lookup tests
* Fix test name
* Change var name for clarity
Occurrences of the old term have been replaced by the new term. However,
the documentation still needs some work to reflect the new Entra ID
screenshots and terminology.
* 17195 Add color to PowerOutlet
* 17195 Add color to PowerOutlet
* Reorder serializer fields
* Misc cleanup
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 17558 raise validation error if removing choice from choiceset that is currently used
* 17558 raise validation error if removing choice from choiceset that is currently used
* 17558 raise validation error if removing choice from choiceset that is currently used
* 17558 add tests
* 17558 add tests
* Tightened up choice evaluation logic a bit; cleaned up test
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Ensure model is defined when rendering bulk_edit_button
* Move model check to inner conditional
* Set model in context
* Return child_model instead of model for use in bulk_edit_button
* Add handling for FieldError to CSVModelChoiceField.to_python to handle invalid accessor field
* manufacturer & default_platform should be CSVModelChoiceFields
* Fix string translation
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Respect the weight unit of the DeviceType when displaying the Device details
* Reuse the same weight formatting construct as in rack.html, and add placeholder in rack if empty
* Add primary_ip4 and primary_ip6 to bulk import form for VDC
* Specify IPAddress querysets with address field accessor and labels
* Filter primary_ip4/ip6 querysets to only those IPs available on the device
* Fix comment
* Make ipv6 help text more correct
* Shorten IPv6 example
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Closes#16926 Adds various USB cable types to front/rear ports and cable choices
* Closes#16926 Changes USB cable types to reflect versions-physical differences. Updated human readable labels on USB front/rear ports to match style of usb console ports
* Closes#16926 Removes USB cable type choices in favor of single, generic 'USB' cable
* Hide exception in ObjectCountsWidget for models without a `xxx_list` view function
Fixes#17341
* Disable hyperlink for invalid view names
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
There is already a logic set earlier in the code to define "user" if --user is passed as parameter, and default to the user with the lowest ID no none is provided.
This patch uses this "user" to run the job instead of always applying the default.
* Add device_status as filtering option (and configurable column) for InventoryItemTable
* Add device_status to common superclasses for Device Components, and refactor ChoiceFieldColumn to support a "color" callable allowing get_FOO_color behavior to be overridden
* Remove unnecessary 'device_status' in fields
* Add unit tests for device_status
* Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set
* Update netbox/netbox/settings.py
* Apply schema adaptations across all apps
* Extend GraphQL API tests
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 17186 change custom link button color from outline-dark to outline-secondary
* 17186 change choice to default
* 17186 change choice to default
* 17186 change choice to default
* Misc cleanup
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 17219 fix custom validator display if function
* 17219 fix custom validator display if function
* 17219 use custom json encoder
* Fix system config export
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 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
* 16946 raise error if filterset is not valid
* 16946 cleanup
* 16946 change to None qs return and add test
* Remove obsolete logic
* Clean up test case
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Resolve $user token to User.id for use in permissions based on custom fields
* Cleaner type check
* Simplify User object check by updating tokens instead of resolved values
* change caret to html entity to fix safari performacne issue
* change caret to html entity to fix safari performacne issue
* 17117 use material icon
* 17117 use material icon
* 17117 use material icon
* 17117 fix vertical align
* Add comments & tweak padding
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Add clamp_height to the markdown filter which limits max height to 200 (scrollable) on the container div
* Remove clamp_height option, apply scrolling style to all markdown divs inside td's
* 17174 add version to plugin catalog
* Retain the created & updated columns for optional use
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Fixes#17097: Record static object representation when calling NotificationGroup.notify()
* Redirect to notifications list when marking as read notifications for deleted objects
* Link to object in notifications dropdown only for non-destructive events
* Translate django.po in ru
100% translated source file: 'django.po'
on 'ru'.
* Translate django.po in de
100% translated source file: 'django.po'
on 'de'.
* Translate django.po in ja [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'ja'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in fr [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in es [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in pt [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'pt'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in tr [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'tr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in it [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in zh [Manual Sync]
99% of minimum 1% translated source file: 'django.po'
on 'zh'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in pl [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'pl'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in nl [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'nl'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in uk [Manual Sync]
99% of minimum 1% translated source file: 'django.po'
on 'uk'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in cs [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'cs'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in da [Manual Sync]
98% of minimum 1% translated source file: 'django.po'
on 'da'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate django.po in zh
100% translated source file: 'django.po'
on 'zh'.
* Translate django.po in cs
100% translated source file: 'django.po'
on 'cs'.
* Translate django.po in da
100% translated source file: 'django.po'
on 'da'.
* Translate django.po in nl
100% translated source file: 'django.po'
on 'nl'.
* Translate django.po in fr
100% translated source file: 'django.po'
on 'fr'.
* Translate django.po in it
100% translated source file: 'django.po'
on 'it'.
* Translate django.po in ja
100% translated source file: 'django.po'
on 'ja'.
* Translate django.po in pl
100% translated source file: 'django.po'
on 'pl'.
* Translate django.po in pt
100% translated source file: 'django.po'
on 'pt'.
* Translate django.po in es
100% translated source file: 'django.po'
on 'es'.
* Translate django.po in tr
100% translated source file: 'django.po'
on 'tr'.
* Translate django.po in uk
100% translated source file: 'django.po'
on 'uk'.
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* 16073 set default custom fields on CSV import
* 16073 add test case
* Remove second for loop
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* add 'vlan' to prefix bulk edit
* Move VLAN fields to a separate field set in bulk edit form
---------
Co-authored-by: Pieter Lambrecht <pieter.lambrecht@accenture.com>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 16649 general contrast issues (#16759)
* fixes#16647: navigation contrast issues updated
* fixes#16651: table contrast issues new
* fixed#16649: general contrast issues
* fixes#16649: feedback changes
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.broadband>
* 16648 dashboard contrast issues (#16824)
* fixed#16648: dashboard contrast issues
* reinstate amendment to 16649
* fixed#16648: created gridstack override and removed inline bug fix
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
* fixed#16853: accessibility issues
* fixed#16847: updated font (#16848)
* fixed#16847: updated font
* fixed#16847: changed font to local and added current font as fallback
* fixed#16847: removed inter and added padding to page header
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 16849 document hierarchy issues (#16875)
* fixed#16849: h elements not in sequential order
* fixed#16849: Lists do not contain only li elements
* fixed#16849: fixed h hierarchy on rack object pages
* Remove standalone h5 classes
* Remove unnecessary line breaks
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 16650 button contrast issues (#16845)
* fixed#16650: button contrast issues
* fixed#16650: green bg text contrast issue
* Revert errant JS resource updates
* Revert custom button colors
* Fix indentation
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 16907 web UI refresh (#16915)
* closes#16907: web ui refresh
* closes#16907: changed default widget color to primary color
* closes#16907: removed comma
* Revert dashboard widget color changes
* Rename logo images for consistency
* Restore original dashboard widget config
* Remove .navbar-brand-autodark from logo
* Restore logo file names
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* 16394 distinguish product edition (#16924)
* closes#16907: web ui refresh
* closes#16907: changed default widget color to primary color
* closes#16907: removed comma
* closes#16394: distinguish product edition
* Revert dashboard changes
* Clean up redundant styling (merge error)
* removed labs logo and added sub text for all editions
* fixed motif bug
* Fix "flashing" of side nav under dark mode
* Use title case for edition label
* altered edition text style
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Query release features to toggle commercial theme
* fixes dark mode primary button contrast issue
* fixes#16913: hidden admin nav link (#16978)
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* fixed 16852: misc accessbility problems (#16977)
* fixed 16852: misc accessbility problems
* Restore tooltip text
* Add translation support
* Add missing i18n
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* fixes issues in #16850 (#16986)
* fixes issues in #16850: issue 3 and 5
* Add link text for 'clear' button on table column
* Translate aria label
---------
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Use alternate footer links for commercial releases
* Remove Inter font
* Adjust base font weight to 500
* Retain default text color for hyperlinks inside tables
* Logo & edition cleanup
* Move dashboard styling
* Misc cleanup
* Remove unused styles
* Misc cleanup & refactoring
---------
Co-authored-by: Andrew Gormley <andrewgormley91@gmail.com>
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.broadband>
* Introduce reusable BackgroundJob framework
A new abstract class can be used to implement job function classes. It
handles the necessary logic for starting and stopping jobs, including
exception handling and rescheduling of recurring jobs.
This commit also includes the migration of data source jobs to the new
framework.
* Restore using import_string for jobs
Using the 'import_string()' utility from Django allows the job script
class to be simplified, as module imports no longer need to avoid loops.
This should make it easier to queue and maintain jobs.
* Use SyncDataSourceJob for management command
Instead of maintaining two separate job execution logics, the same job
is now used for both background and interactive execution.
* Implement BackgroundJob for running scripts
The independent implementations of interactive and background script
execution have been merged into a single BackgroundJob implementation.
* Fix documentation of model features
* Ensure consitent code style
* Introduce reusable ScheduledJob
A new abstract class can be used to implement job function classes that
specialize in scheduling. These use the same logic as regular
BackgroundJobs, but ensure that they are only scheduled once at any given
time.
* Introduce reusable SystemJob
A new abstract class can be used to implement job function classes that
specialize in system background tasks (e.g. synchronization or
housekeeping). In addition to the features of the BackgroundJob and
ScheduledJob classes, these implement additional logic to not need to be
bound to an existing NetBox object and to setup job schedules on plugin
load instead of an interactive request.
* Add documentation for jobs framework
* Revert "Use SyncDataSourceJob for management"
This partially reverts commit db591d4. The 'run_now' parameter of
'enqueue()' remains, as its being used by following commits.
* Merge enqueued status into JobStatusChoices
* Fix logger for ScriptJob
* Remove job name for scripts
Because scripts are already linked through the Job Instance field, the
name is displayed twice. Removing this reduces redundancy and opens up
the possibility of simplifying the BackgroundJob framework in future
commits.
* Merge ScheduledJob into BackgroundJob
Instead of using separate classes, the logic of ScheduledJob is now
merged into the generic BackgroundJob class. This allows reusing the
same logic, but dynamically deciding whether to enqueue the same job
once or multiple times.
* Add name attribute for BackgroundJob
Instead of defining individual names on enqueue, BackgroundJob classes
can now set a job name in their meta class. This is equivalent to other
Django classes and NetBox scripts.
* Drop enqueue_sync_job() method from DataSource
* Import ScriptJob directly
* Relax requirement for Jobs to reference a specific object
* Rename 'run_now' arg on Job.enqueue() to 'immediate'
* Fix queue lookup in Job enqueue
* Collapse SystemJob into BackgroundJob
* Remove legacy JobResultStatusChoices
ChoiceSet was moved to core in 40572b5.
* Use queue 'low' for system jobs by default
System jobs usually perform low-priority background tasks and therefore
can use a different queue than 'default', which is used for regular jobs
related to specific objects.
* Add test cases for BackgroundJob handling
* Fix enqueue interval jobs
As the job's name is set by enqueue(), it must not be passed in handle()
to avoid duplicate kwargs with the same name.
* Honor schedule_at for job's enqueue_once
Not only can a job's interval change, but so can the time at which it is
scheduled to run. If a specific scheduled time is set, it will also be
checked against the current job schedule. If there are any changes, the
job is rescheduled with the new time.
* Switch BackgroundJob to regular methods
Instead of using a class method for run(), a regular method is used for
this purpose. This gives the possibility to add more convenience methods
in the future, e.g. for interacting with the job object or for logging,
as implemented for scripts.
* Fix background tasks documentation
* Test enqueue in combination with enqueue_once
* Rename background jobs to tasks (to differentiate from RQ)
* Touch up docs
* Revert "Use queue 'low' for system jobs by default"
This reverts commit b17b2050df.
* Remove system background job
This commit reverts commits 4880d81 and 0b15ecf. Using the database
'connection_created' signal for job registration feels a little wrong at
this point, as it would trigger registration very often. However, the
background job framework is prepared for this use case and can be used
by plugins once the auto-registration of jobs is solved.
* Fix runscript management command
Defining names for background jobs was disabled with fb75389. The
preceeding changes in 257976d did forget the management command.
* Use regular imports for ScriptJob
* Rename BackgroundJob to JobRunner
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Closes#16964: Validate password when creating a new user or updating password for an existing user
* Add serializer validation & tests
---------
Co-authored-by: Nishant Gaglani <nishantgaglani@gmail.com>
* 12826 add RackType
* 12826 add forms, filters, tables
* 12826 add to menu
* 12826 remove role
* 12826 add api/serializers
* 12826 add tests and fixes
* 12826 fix tests
* 12826 fix tests
* 12826 fix tests
* 12826 fix tests
* 12826 add device_type to device and instantiation
* 12826 test device creation
* 12826 add slug
* 12826 fix tests
* 12826 fix slug field
* 12826 prevent modification of rack fields if rack_type set
* 12826 update rack fields on rack_type edit
* Misc cleanup
* Update model docs
* Add manufacturer field to RackType
* Add test for mounting_depth
* Rename 'type' to 'form_factor'
* Create base classes for Rack & RackType models, serializers
* Hide RackType-defined fields on RackForm when a rack type is set
* Establish a base filter form for Rack & RackType
* Clean up RackType attr inheritance
* Clean up templates
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Initial work on #15621
* Signal receiver should ignore models which don't support notifications
* Flesh out NotificationGroup functionality
* Add NotificationGroup filters for users & groups
* Separate read & dimiss actions
* Enable one-click dismissals from notifications list
* Include total notification count in dropdown
* Drop 'kind' field from Notification model
* Register event types in the registry; add colors & icons
* Enable event rules to target notification groups
* Define dynamic choices for Notification.event_name
* Move event registration to core
* Add more job events
* Misc cleanup
* Misc cleanup
* Correct absolute URLs for notifications & subscriptions
* Optimize subscriber notifications
* Use core event types when queuing events
* Standardize queued event attribute to event_type; change content_type to object_type
* Rename Notification.event_name to event_type
* Restore NotificationGroupBulkEditView
* Add API tests
* Add view & filterset tests
* Add model documentation
* Fix tests
* Update notification bell when notifications have been cleared
* Ensure subscribe button appears only on relevant models
* Notifications/subscriptions cannot be ordered by object
* Misc cleanup
* Add event icon & type to notifications table
* Adjust icon sizing
* Mute color of read notifications
* Misc cleanup
* Fixes 16536 - Fix filtering of device component by device role
Rename role and role_id fields to device_role and device_role_id in
DeviceComponentFilterSet
* Update tests for DeviceComponentFilterSet
* Use device_role filter name for DeviceComponentFilterSetTests
* Add test_device_role test in InventoryItemTestCase
* Added CS, DA, IT, NL, and PL, minus the .po and .mo starting point files
* Add initial PO files for new languages
* Revert updates to EN django.po
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Fixes#16760: datasource git on local file system fails
* Fixes#16760: datasource git on local file system fails
* Set depth & quiet parameters only if using a remote URL
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>