1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

85 Commits

Author SHA1 Message Date
518fd8cca6 12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model

* 12794 call get_user_model once in tests

* 12794 call get_user_model once in tests

* 12794 use settings.AUTH_USER_MODEL for FK reference
2023-06-22 08:26:50 -04:00
f3826e6235 fix runscript command 2023-05-04 16:18:44 -04:00
d2a694a878 Closes #12068: Establish a direct relationship from jobs to objects (#12075)
* Reference database object by GFK when running scripts & reports via UI

* Reference database object by GFK when running scripts & reports via API

* Remove old enqueue_job() method

* Enable filtering jobs by object

* Introduce ObjectJobsView

* Add tabbed views for report & script jobs

* Add object_id to JobSerializer

* Move generic relation to JobsMixin

* Clean up old naming
2023-03-28 15:47:09 -04:00
7b258dc11f Rename JOBRESULT_RETENTION to JOB_RETENTION 2023-03-27 14:20:13 -04:00
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
5c0ce96b6f Reorganize management commands 2023-03-24 21:11:10 -04:00
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
2a9178af12 Merge branch 'develop' into feature 2023-03-13 11:58:37 -04:00
a8c331f88a Replace JobResult.set_status() with terminate() 2023-03-07 18:01:32 -05:00
5a4d8a7107 Closes #11787: Rebuild any missing search cache entires after upgrade 2023-02-20 09:49:13 -05:00
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
edbd597bf2 Update housekeeping command docs 2023-02-07 16:52:54 -05:00
07df622b59 NetBox should always be referred to as NetBox [DATALAD RUNCMD]
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "git ls-files -z . | xargs --null -I '()' find './()' -type f -not -name 'style-guide.md' -print0 | xargs --null sed --in-place --regexp-extended 's/\\bNetbox\\b/NetBox/g;'",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
2023-01-05 16:06:00 -05:00
ae440c9edf Fixes #11223 - Accept app_label for reindex 2022-12-28 16:35:05 -05:00
81c0dce5a3 Closes #10697: Move application registry into core app 2022-11-02 15:25:22 -04:00
9628dead07 Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
ed2f7f1236 Job scheduling review changes 2022-10-21 10:31:30 +02:00
d647983003 Always activate scheduler functionality when running the rqworker management command 2022-10-16 13:47:15 +02:00
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
356ff457be Allow reports to be nested in submodules 2022-09-14 19:57:37 +02:00
e2eb7fdfb5 Clear webhook queue on script failure 2022-06-03 13:03:58 +02:00
7b5625a722 Add management command for clearing cache 2022-04-29 09:19:19 +02:00
aa2ec3b9c9 Add dynamic config JOBRESULT_RETENTION
and cleanup functionality to the housekeeping script
2022-04-12 11:42:47 -04:00
f13a00b2dd Save old JobResults 2022-04-12 11:42:47 -04:00
36d6ae33d1 Allow setting individual timeouts on scripts and reports 2022-04-04 18:00:38 +02:00
d1b1a45725 Enable tab completion in nbshell 2022-02-13 03:00:57 -05:00
b6ff55309e Fixes #8078: Add missing wireless models to lsmodels() in nbshell 2021-12-15 08:38:19 -05:00
2a00519b93 Move CHANGELOG_RETENTION to dyanmic configuration 2021-11-08 15:07:58 -05:00
b97167e841 Fix PEP8 error 2021-11-02 21:40:40 -05:00
19bacc9e23 #6529 - Adjusted the arguments. Fixed documentation 2021-11-02 21:37:11 -05:00
7c3318df92 #6529 - Adjusted the arguments. Added documentation 2021-11-02 15:56:42 -05:00
b7c0e8b71f #6529 - Streamline code and resolve some issues 2021-11-02 13:12:12 -05:00
0a62f75a40 #6529 - Add CLI to run scripts 2021-10-28 15:14:42 -05:00
376c776520 Fixes #7425: Housekeeping command should honor zero verbosity 2021-10-01 15:29:22 -04:00
499005f84d Merge branch 'develop' into feature 2021-08-23 13:23:39 -04:00
75c62ff729 Print request index after webhook data dump 2021-08-23 11:32:47 -04:00
fe1f221286 Log a warning when rqworker invoked without specified queues 2021-07-09 21:23:27 -04:00
e173c8b548 Add release check to the housekeeping task 2021-07-07 21:37:35 -04:00
b6ec1d9aa7 Remove cacheops workarounds & queryset caching metrics 2021-07-07 17:15:42 -04:00
d87ec82fe3 Closes #6590: Introduce a nightly housekeeping command to clear expired sessions and change records 2021-06-11 10:44:17 -04:00
744792452f Closes: #5278 - Remove Secrets (#6397)
* Remove Secrets

* #5278: Remove secrets javascript from netbox core

* Remove userkey references

* Fix PEP8

* Remove a few more instances of secrets.  Rebundle

* Remove Secrets

Co-authored-by: checktheroads <matt@allroads.io>
2021-05-17 16:26:02 -04:00
bac2387f50 Merge branch 'develop' into feature 2021-03-09 20:04:20 -05:00
c3ad2d0a80 Fixes #5948: Invalidate cached queries when running renaturalize 2021-03-09 16:39:55 -05:00
c083b862a7 Improve JSON output formatting of webhook receiver 2021-03-09 12:03:56 -05:00
27e27788cd Closes #5424: Allow passing Python code to nbshell using --command 2020-12-08 16:14:52 -05:00
0a40418614 Fixes #5066: Update view_reportresult to view_report permission 2020-09-23 13:40:15 -04:00
c5e82a3895 fixes #5108 - correct the runreport management command to work with JobResults model 2020-09-10 17:43:41 -04:00
0b1df1483f Automatically import ContentType when entering nbshell 2020-06-30 16:34:53 -04:00
ae58af4bb7 Added webhook_receiver management command 2020-04-07 13:37:48 -04:00
a2eb2e7da6 Introduce a new 'check_releases' RQ queue 2020-03-17 11:22:56 -04:00