Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend PluginTemplateExtension to render custom alerts for objects #16776

Closed
jeremystretch opened this issue Jul 1, 2024 · 0 comments
Closed
Assignees
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

NetBox version

v4.0.6

Feature type

New functionality

Proposed functionality

Add a new render_alerts() method on PluginTemplateExtension, which returns an iterable of alerts to be displayed at the top of the page when viewing an object. Each item in the iterable will be a two-tuple containing the message content and classification (e.g. info, warning, etc.).

Use case

This will enable a plugin to embed arbitrary notes or alerts pertaining to specific objects within NetBox. For example, it might be used by a plugin to indicate that a certain object is out of sync with external data or that some action is required to rectify a problem.

Database changes

None

External dependencies

None

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application complexity: low Requires minimal effort to implement labels Jul 1, 2024
@jeremystretch jeremystretch added this to the v4.1 milestone Jul 1, 2024
@jeremystretch jeremystretch self-assigned this Jul 1, 2024
jeremystretch added a commit that referenced this issue Jul 12, 2024
… for objects (#16889)

* Closes #16776: Extend PluginTemplateExtension to render custom alerts for objects

* Fix bug in _get_registered_content()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

1 participant