Commit Graph

177 Commits

Author SHA1 Message Date
Darek
89fa546a14
Merge pull request from GHSA-92x4-vfjf-rmf7 2023-04-21 15:08:04 -04:00
jeremystretch
08017c51f6 Merge branch 'develop' into feature 2023-04-07 13:00:00 -04:00
gdprdatasubect
fbc23424a6 Update models.py
Change default MIME-Type as discussed under #12095
2023-03-30 16:58:41 -04:00
jeremystretch
15590f1f48 Merge branch 'develop' into feature 2023-03-28 14:19:08 -04:00
Arthur Hanson
654e32cbbe
11933 saved filters clone of content-types and add m2m field cloning (#12014)
* 11933 saved filters clone of content-types and add m2m field cloning

* Fix JSON rendering

* Add content_types to CustomLink.clone()

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-28 09:53:57 -04:00
Arthur
835af32213 12008 make export templates cloneable 2023-03-28 09:45:44 -04:00
jeremystretch
82080ef491 Remove the old JobResult model 2023-03-27 14:20:13 -04:00
jeremystretch
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
jeremystretch
ea1801bad3 Refactor extras.models 2023-03-24 21:25:22 -04:00
Jeremy Stretch
f7a2eb8aef
Closes #11890: Sync/upload reports & scripts (#12059)
* Initial work on #11890

* Consolidate get_scripts() and get_reports() functions

* Introduce proxy models for script & report modules

* Add add/delete views for reports & scripts

* Add deletion links for modules

* Enable resolving scripts/reports from module class

* Remove get_modules() utility function

* Show results in report/script lists

* Misc cleanup

* Fix file uploads

* Support automatic migration for submodules

* Fix module child ordering

* Template cleanup

* Remove ManagedFile views

* Move is_script(), is_report() into extras.utils

* Fix URLs for nested reports & scripts

* Misc cleanup
2023-03-24 21:00:36 -04:00
jeremystretch
ecb8f1599d #11558: Set data_synced time under model's clean() 2023-03-20 15:45:48 -04:00
jeremystretch
08bdb54cb4 #11558: Disable sync button if RQ worker not running 2023-03-20 15:12:11 -04:00
jeremystretch
9219397208 #8958: Declare constants for event types 2023-03-20 13:04:05 -04:00
jeremystretch
e015da9e4c Undo change to default status for object type_* fields on Webhook 2023-03-07 18:01:32 -05:00
jeremystretch
4de64d783e Add trigger_webhooks() to JobResult 2023-03-07 18:01:32 -05:00
jeremystretch
a8c331f88a Replace JobResult.set_status() with terminate() 2023-03-07 18:01:32 -05:00
jeremystretch
697feed257 Add type_job_start & type_job_end to Webhook 2023-03-07 18:01:32 -05:00
jeremystretch
96a79c2126 Closes #11737: ChangeLoggedModel should inherit WebhooksMixin 2023-02-19 20:09:51 -05:00
jeremystretch
ac87ce733d Closes #11693: Enable remote data synchronization for export templates 2023-02-19 20:09:51 -05:00
Jeremy Stretch
d8784d4155 Closes #11558: Add support for remote data sources (#11646)
* WIP

* WIP

* Add git sync

* Fix file hashing

* Add last_synced to DataSource

* Build out UI & API resources

* Add status field to DataSource

* Add UI control to sync data source

* Add API endpoint to sync data sources

* Fix display of DataSource job results

* DataSource password should be write-only

* General cleanup

* Add data file UI view

* Punt on HTTP, FTP support for now

* Add DataSource URL validation

* Add HTTP proxy support to git fetcher

* Add management command to sync data sources

* DataFile REST API endpoints should be read-only

* Refactor fetch methods into backend classes

* Replace auth & git branch fields with general-purpose parameters

* Fix last_synced time

* Render discrete form fields for backend parameters

* Enable dynamic edit form for DataSource

* Register DataBackend classes in application registry

* Add search indexers for DataSource, DataFile

* Add single & bulk delete views for DataFile

* Add model documentation

* Convert DataSource to a primary model

* Introduce pre_sync & post_sync signals

* Clean up migrations

* Rename url to source_url

* Clean up filtersets

* Add API & filterset tests

* Add view tests

* Add initSelect() to HTMX refresh handler

* Render DataSourceForm fieldsets dynamically

* Update compiled static resources
2023-02-19 20:09:51 -05:00
kkthxbye
1354947434 Get the queue from QUEUE_MAPPINGS when deleting JobResults 2023-01-09 08:22:40 -05:00
Renato Almeida de Oliveira
35273cc87f
Add ExportTemplatesMixin to JournalEntry model (#11251)
* Add ExportTemplatesMixin to JournalEntry model

* Move mixin ahead of base class

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2023-01-05 16:26:48 -05:00
kkthxbye-code
b35b33e798 Use the start time to calculate duration of jobs instead of created time 2022-12-22 09:52:05 -05:00
Jeremy Stretch
4297c65f87
Closes #10945: Enable recurring execution of scheduled reports & scripts (#11096)
* Add interval to JobResult

* Accept a recurrence interval when executing scripts & reports

* Cleaned up jobs list display

* Schedule next job only if a reference start time can be determined

* Improve validation for scheduled jobs
2022-12-08 18:17:13 -05:00
jeremystretch
6ffd8aa320 Introduce constants for RQ queue names 2022-12-08 09:58:52 -05:00
kkthxbye-code
080a001118 Allow redefining internally used queues 2022-12-08 09:45:21 -05:00
jeremystretch
0bcc59a1e9 #8366: Add started field to JobResult 2022-11-15 15:06:11 -05:00
jeremystretch
87727c71f7 #8366: name scheduled_time to scheduled for consistency with other fields 2022-11-15 13:37:13 -05:00
jeremystretch
640fd8045d #9887: Add missing model documentation links 2022-11-15 11:00:13 -05:00
jeremystretch
355678274d #9623: Add slug field to SavedFilter 2022-11-15 10:44:12 -05:00
Arthur
6eba5d4d96 10300 initial translation support use gettext 2022-11-11 08:47:29 -05:00
Jeremy Stretch
484efdaf75
Closes #9623: Implement saved filters (#10801)
* Initial work on saved filters

* Return only enabled/shared filters

* Add tests

* Clean up filtering of usable SavedFilters
2022-11-02 12:27:53 -04:00
jeremystretch
16919cc1d9 Closes #10761: Enable associating an export template with multiple object types 2022-10-26 13:30:45 -04:00
jeremystretch
9e8234bb45 Closes #8274: Enable associating a custom link with multiple object types 2022-10-26 11:39:26 -04:00
kkthxbye-code
ed2f7f1236 Job scheduling review changes 2022-10-21 10:31:30 +02:00
kkthxbye-code
1d9808a92a Added scheduled_time field to JobResult model 2022-10-16 13:42:28 +02:00
kkthxbye-code
ef0b455b05 Called super delete method before deleting JobResult task.
Done to avoid having deleted a task on accident if the deleting of the JobResult fails.
2022-10-09 21:16:26 +02:00
kkthxbye-code
679a9e839b Work on job scheduling:
* Added JobResult form filtersets
* Change housekeeping cleanup delete from `_raw_delete` to `delete` to make sure scheduled tasks are cancelled
* Change default sort of JobResult table to -created
* Added `delete` override to `JobResult` to remove scheduled tasks from RQ when a JobResult is deleted
* Updated js/css dist files. Will need to be redone when develop is merged to feature.
2022-10-09 21:05:31 +02:00
kkthxbye-code
53c8a48244 Merge branch 'feature' into 8366-job-scheduling
Sync with upstream
2022-10-09 11:18:47 +02:00
jeremystretch
c481a1b6a2 Merge branch 'develop' into feature 2022-10-05 10:28:48 -04:00
jeremystretch
fec8d1bc2f Fixes #10423: Enforce object type validation when creating journal entries 2022-10-04 15:26:52 -04:00
jeremystretch
f51415cf2c Replace unique_together with UniqueConstraints 2022-09-27 15:35:24 -04:00
kkthxbye-code
06dea8ef3f WIP: Moving JobResults out of the admin panel 2022-09-23 13:44:24 +02:00
kkthxbye-code
cbb3378d10 Job Scheduling WIP 2022-09-23 06:45:40 +02:00
kkthxbye
25ac1edb48
Merge branch 'netbox-community:develop' into 8366-job-scheduling 2022-09-18 15:08:11 +02:00
kkthxbye-code
824b4e0923 Add scheduling for reports and scripts 2022-09-18 15:06:28 +02:00
jeremystretch
2b2a41edd2 Enable cloning for custom fields & custom links 2022-09-09 16:51:18 -04:00
jeremystretch
c5fb7b72f0 Closes #9391: Remove 500-character limit for custom link text & URL fields 2022-07-28 14:36:20 -04:00
kkthxbye-code
69b4d0d44b #9028 - Fix pep8 syntax 2022-04-04 18:13:13 +02:00
kkthxbye-code
36d6ae33d1 Allow setting individual timeouts on scripts and reports 2022-04-04 18:00:38 +02:00
jeremystretch
1d55c04c21 Closes #9006: Enable custom fields, custom links, and tags for journal entries 2022-03-31 11:40:02 -04:00
jeremystretch
1319b62acb Standardize on get_FOO_color() method for returning ChoiceField colors 2022-02-11 14:25:13 -05:00
jeremystretch
71d3dc6e44 Improve ChoiceFieldColumn to not rely on model method to derive label color 2022-02-10 16:29:19 -05:00
jeremystretch
272d6e7437 Closes #8463: Change the created field on all change-logged models from date to datetime 2022-02-08 14:41:44 -05:00
jeremystretch
b67859832a Refactor to_objectchange() 2022-01-26 20:25:23 -05:00
jeremystretch
e4abbfb2c6 Closes #8454: Set DEFAULT_AUTO_FIELD to BigAutoField 2022-01-25 17:37:06 -05:00
jeremystretch
571e9801f3 Closes #8195: Ensure all GenericForeignKey ID fields employ PositiveBigIntegerField 2022-01-24 16:02:54 -05:00
jeremystretch
cdae0c2bef Remove extras_features() decorator 2022-01-19 15:16:10 -05:00
Martin Rødvand
5cbc978cad
Render the payload_url of the Webhook with Jinja2
- Update markdown documentation
- Expand on the help text for the Webhook model
2022-01-12 21:58:19 +01:00
jeremystretch
72e17914e2 Closes #8296: Allow disabling custom links 2022-01-10 12:11:37 -05:00
jeremystretch
9f53497e39 Clean up & expand button color choices 2021-12-29 20:28:12 -05:00
jeremystretch
2dd165bbef Merge branch 'develop' into feature 2021-12-23 08:32:40 -05:00
jeremystretch
3d7d19b608 Move rendering logic under CustomLink class 2021-12-22 20:25:57 -05:00
jeremystretch
0d3b50a5e5 Support CSS class definition directly in CHOICES iterable 2021-12-16 10:03:23 -05:00
jeremystretch
424ac29131 Closes #7812: Enable change logging for image attachments 2021-11-17 11:52:50 -05:00
jeremystretch
cede27b5fe Merge branch 'develop' into feature 2021-11-12 09:09:15 -05:00
jeremystretch
0b705553a5 Fixes #7809: Add missing export template support for various models 2021-11-11 16:16:54 -05:00
jeremystretch
d529c1b5b3 Housekeeping: Use RestrictedQuerySet for default manager on base models 2021-11-11 15:04:22 -05:00
jeremystretch
f93d6813a9 Merge branch 'develop' into feature 2021-11-09 16:52:36 -05:00
jeremystretch
3ad773beb3 Fixes #7741: Fix 404 when attaching multiple images in succession 2021-11-09 16:46:58 -05:00
jeremystretch
70f71e0f57 Extend admin UI to allow restoring previous config revisions 2021-10-27 14:05:49 -04:00
jeremystretch
ff5c274048 Ensure bootstrapping of config on start 2021-10-26 16:45:53 -04:00
jeremystretch
82243732a1 Initial work on #5883 2021-10-25 16:10:50 -04:00
jeremystretch
78ecc8673c Add conditions for webhooks 2021-10-22 17:15:08 -04:00
jeremystretch
3203db07b7 UI cleanup 2021-08-26 14:48:24 -04:00
jeremystretch
88e382e7a1 Merge v2.11.8 changes 2021-07-06 12:10:29 -04:00
Robin Schneider
0ad9b83623
Closes #5503: ISO 8601 date in UI and alternative format as tooltip
With this commit all dates in the UI are now consistently displayed.

I changed the long date format as suggested by @xkilian and confirmed by my own
research.

* DATETIME_FORMAT
 * Before July 20, 2020 4:52 p.m.
 * Now 20th July, 2020 16:52

"20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and
"of" are never written.

The only exception is `object_list.html`. I tried it but there it does not
work so easily because the dates are passed to Jinja as SafeString.
2021-07-02 22:22:37 +02:00
jeremystretch
4e0b795a3c Add UI views for webhooks 2021-06-23 21:30:23 -04:00
jeremystretch
10cbbee947 Add UI views for export templates 2021-06-23 20:56:50 -04:00
jeremystretch
276ded0119 Add UI views for custom links 2021-06-23 17:10:04 -04:00
jeremystretch
43a823d0ac Closes #3665: Enable rendering export templates via REST API 2021-05-11 15:51:36 -04:00
jeremystretch
2618dde1e2 Fixes #6236: Journal entry title should account for configured timezone 2021-04-23 15:27:58 -04:00
jeremystretch
b393ec2856 Enable webhooks for JournalEntry 2021-04-14 14:55:01 -04:00
jeremystretch
a296a9e109 Closes #6150: Enable change logging for journal entries 2021-04-13 10:53:55 -04:00
jeremystretch
f8903a8183 Merge branch 'develop' into feature 2021-04-12 14:19:30 -04:00
jeremystretch
7ddcec3a0d Fixes #6082: Support colons in webhook header values 2021-04-12 12:09:37 -04:00
Martin Rødvand
878154c305 Closes #5830: Add as_attachment field to API serializers and admin view. 2021-03-30 23:26:55 +02:00
Martin Rødvand
9ede726eea Add boolean as_attachment to Export template 2021-03-30 22:27:26 +02:00
Jeremy Stretch
93353e94a2 Note that 'table' is a reserved name for ExportTemplates 2021-03-29 11:25:57 -04:00
Jeremy Stretch
8a8342b106 Strip microseconds from JournalEntry creation time 2021-03-29 09:48:45 -04:00
Jeremy Stretch
82fbd975f1 Add kind field to JournalEntry 2021-03-17 12:51:39 -04:00
Jeremy Stretch
8be4fbbce3 Add JournalEntry list view w/filtering 2021-03-16 15:57:23 -04:00
Jeremy Stretch
1f1a62da67 Initial work on #151: Object journaling 2021-03-16 15:00:08 -04:00
Jeremy Stretch
e97adcb614 Move ConfigContext classes out of models.py 2021-03-16 13:08:07 -04:00
Jeremy Stretch
c072ba088f Add webhook support for additional models 2021-03-10 14:49:02 -05:00
Jeremy Stretch
19b78e63ce Introduce ChangeLoggedModel as a standard model 2021-03-10 13:37:13 -05:00
Jeremy Stretch
6ffadb501b Closes #5610: Add REST API endpoint for webhooks 2021-03-09 09:22:58 -05:00
Jeremy Stretch
38ded66c4e Closes #5608: Add REST API endpoint for custom links 2021-03-08 20:57:44 -05:00
Jeremy Stretch
79b19821f6
Closes #5892: Introduce SiteGroup model (#5937)
* Initial work on #5892

* Add site group selection to object edit forms

* Add documentation for site groups

* Changelog for #5892

* Finish application of site groups to config context
2021-03-08 13:28:53 -05:00
Jeremy Stretch
7e6cb9d186 Closes #1638: Migrate all primary keys to 64-bit integers 2021-02-26 16:12:52 -05:00