[PR #19721] [MERGED] Fixes: #19492: Add Save Button to Script Output Window #15715

Closed
opened 2025-12-30 00:23:36 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19721
Author: @Omripresent
Created: 6/18/2025
Status: Merged
Merged: 6/19/2025
Merged by: @jeremystretch

Base: mainHead: feat-19492


📝 Commits (3)

  • 5f47ba4 Add condition to ScriptResultView.get function to generate a download
  • 5d71a4e Update template script_result.html adding a download button to trigger
  • e5bf33f Simplify conditional logic; tweak timestamp format

📊 Changes

2 files changed (+20 additions, -2 deletions)

View changed files

📝 netbox/extras/views.py (+10 -1)
📝 netbox/templates/extras/htmx/script_result.html (+10 -1)

📄 Description

Fixes: #19492: Add Save Button to Script Output Window

  • Added download button to script_result.html template following the same model of object_render_config.html
  • Added logic to ScriptResultView.get function to trigger content download when matching log or output.
    • Output export responds with the raw content of the script result
    • Log export responds with a CSV formatted content of the log table matching the visible table columns (works for both scripts and 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/19721 **Author:** [@Omripresent](https://github.com/Omripresent) **Created:** 6/18/2025 **Status:** ✅ Merged **Merged:** 6/19/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `feat-19492` --- ### 📝 Commits (3) - [`5f47ba4`](https://github.com/netbox-community/netbox/commit/5f47ba4fb2ac9fc637ca2c786ed01751918259d3) Add condition to ScriptResultView.get function to generate a download - [`5d71a4e`](https://github.com/netbox-community/netbox/commit/5d71a4e3e215fd89ece6404bfdcd1c04b888ad07) Update template script_result.html adding a download button to trigger - [`e5bf33f`](https://github.com/netbox-community/netbox/commit/e5bf33fc47e2e4bf6deb0cff66e96668bcb758e4) Simplify conditional logic; tweak timestamp format ### 📊 Changes **2 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/views.py` (+10 -1) 📝 `netbox/templates/extras/htmx/script_result.html` (+10 -1) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #19492: Add Save Button to Script Output Window <!-- Please include a summary of the proposed changes below. --> * Added download button to script_result.html template following the same model of object_render_config.html * Added logic to ScriptResultView.get function to trigger content download when matching log or output. * Output export responds with the raw content of the script result * Log export responds with a CSV formatted content of the log table matching the visible table columns (works for both scripts and 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-30 00:23:36 +01:00
adam closed this issue 2025-12-30 00:23:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15715