[PR #12059] [MERGED] Closes #11890: Sync/upload reports & scripts #13900

Closed
opened 2025-12-29 23:21:26 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/12059
Author: @jeremystretch
Created: 3/24/2023
Status: Merged
Merged: 3/25/2023
Merged by: @jeremystretch

Base: featureHead: 11890-sync-reports-scripts


📝 Commits (10+)

📊 Changes

23 files changed (+658 additions, -315 deletions)

View changed files

📝 netbox/core/choices.py (+14 -1)
📝 netbox/core/forms/model_forms.py (+36 -0)
netbox/core/migrations/0002_managedfile.py (+39 -0)
📝 netbox/core/models/__init__.py (+1 -0)
📝 netbox/core/models/data.py (+13 -1)
netbox/core/models/files.py (+88 -0)
📝 netbox/extras/api/views.py (+13 -15)
📝 netbox/extras/management/commands/runreport.py (+5 -9)
netbox/extras/migrations/0091_create_managedfiles.py (+86 -0)
📝 netbox/extras/models/__init__.py (+2 -0)
📝 netbox/extras/models/models.py (+116 -3)
📝 netbox/extras/reports.py (+20 -64)
📝 netbox/extras/scripts.py (+18 -75)
📝 netbox/extras/urls.py (+10 -6)
📝 netbox/extras/utils.py (+22 -0)
📝 netbox/extras/views.py (+60 -48)
📝 netbox/templates/extras/htmx/report_result.html (+1 -1)
📝 netbox/templates/extras/htmx/script_result.html (+1 -1)
netbox/templates/extras/inc/job_label.html (+0 -15)
📝 netbox/templates/extras/report.html (+1 -1)

...and 3 more files

📄 Description

Closes: #11890

  • Introduce the ManagedFile core model to managing files on disk
  • Introduce ScriptModule and ReportModule classes, which serve as proxies for ManagedFile
  • Add views to create & delete modules via the UI
  • Clean up a ton of old code pertaining to the discovery of scripts & reports

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/12059 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/24/2023 **Status:** ✅ Merged **Merged:** 3/25/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `11890-sync-reports-scripts` --- ### 📝 Commits (10+) - [`ba7fab3`](https://github.com/netbox-community/netbox/commit/ba7fab3a5df4dd4bef9631d77ad6dbbf7e838685) Initial work on #11890 - [`ab4a38d`](https://github.com/netbox-community/netbox/commit/ab4a38d32dbc76fb48fd01d70321bc75aa0bdd50) Consolidate get_scripts() and get_reports() functions - [`1daac5f`](https://github.com/netbox-community/netbox/commit/1daac5f781df5dd6817459dbe1bb145629b9782c) Introduce proxy models for script & report modules - [`b2bba7f`](https://github.com/netbox-community/netbox/commit/b2bba7fc4073d3a3cb41a1cc92baea6303466651) Add add/delete views for reports & scripts - [`bfccd68`](https://github.com/netbox-community/netbox/commit/bfccd6820e64b415286262f5d7c5b3edde70a2db) Add deletion links for modules - [`f5830c1`](https://github.com/netbox-community/netbox/commit/f5830c1cd829681ddd2752643e462887dc81b121) Enable resolving scripts/reports from module class - [`107c46c`](https://github.com/netbox-community/netbox/commit/107c46cb7a5c4787c688271032c9e737bd46265b) Remove get_modules() utility function - [`b2257b6`](https://github.com/netbox-community/netbox/commit/b2257b613e05ac8c2f19034354c31a4fa7a055a7) Show results in report/script lists - [`090a281`](https://github.com/netbox-community/netbox/commit/090a28131ea74f94fca161bc7331b8714b39d786) Misc cleanup - [`c20eeb8`](https://github.com/netbox-community/netbox/commit/c20eeb8114781eefcc0ec0caa353a4ce131ad795) Fix file uploads ### 📊 Changes **23 files changed** (+658 additions, -315 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/choices.py` (+14 -1) 📝 `netbox/core/forms/model_forms.py` (+36 -0) ➕ `netbox/core/migrations/0002_managedfile.py` (+39 -0) 📝 `netbox/core/models/__init__.py` (+1 -0) 📝 `netbox/core/models/data.py` (+13 -1) ➕ `netbox/core/models/files.py` (+88 -0) 📝 `netbox/extras/api/views.py` (+13 -15) 📝 `netbox/extras/management/commands/runreport.py` (+5 -9) ➕ `netbox/extras/migrations/0091_create_managedfiles.py` (+86 -0) 📝 `netbox/extras/models/__init__.py` (+2 -0) 📝 `netbox/extras/models/models.py` (+116 -3) 📝 `netbox/extras/reports.py` (+20 -64) 📝 `netbox/extras/scripts.py` (+18 -75) 📝 `netbox/extras/urls.py` (+10 -6) 📝 `netbox/extras/utils.py` (+22 -0) 📝 `netbox/extras/views.py` (+60 -48) 📝 `netbox/templates/extras/htmx/report_result.html` (+1 -1) 📝 `netbox/templates/extras/htmx/script_result.html` (+1 -1) ➖ `netbox/templates/extras/inc/job_label.html` (+0 -15) 📝 `netbox/templates/extras/report.html` (+1 -1) _...and 3 more files_ </details> ### 📄 Description ### Closes: #11890 - Introduce the `ManagedFile` core model to managing files on disk - Introduce `ScriptModule` and `ReportModule` classes, which serve as proxies for `ManagedFile` - Add views to create & delete modules via the UI - Clean up a ton of old code pertaining to the discovery of scripts & reports --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:21:26 +01:00
adam closed this issue 2025-12-29 23:21:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13900