netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Implement pagination, filtering, and export functionality for report and script results

Open atownson opened this issue 3 years ago • 9 comments

NetBox version

v3.3.5

Feature type

New functionality

Proposed functionality

My proposal is to implement pagination, filtering, and export options for the report Report Results panel and the script Script Log panel.

For pagination, implement pagination for reports (Report Results panel) and scripts (Script Log panel) in the same manner as the model table pages, with a Per Page input.

As far as filtering for reports, the current Report Methods panel provides hyperlinks to the method results in the Report Results panel. Instead of grouping the results by Method in the Report Results panel, create a new "Method" column which could be filtered. Perhaps the Report Methods panel hyperlinks could be transitioned to provide quick filters rather than hyperlinks. My suggestion for filtering options would be to provide dropdown inputs to filter the Method and Level fields and textboxes to filter the Object and Message fields. Filters could be provided in a Filters tab, similar to the model table pages, to conserve real estate on the page.

My suggestion for filtering the Script Log for scripts would be to provide a dropdown input to filter the Level field and a textbox to search the Message field.

For export, implement exporting for reports (Report Results panel) and scripts (Script Log panel) in a similar manner as the model table pages, with an Export dropdown. I don't see a need for export template functionality. But rather simply "Export All" and "Export Filtered" options to export all results and the currently filtered results respectively.

Use case

Pagination would prevent the page content from becoming too large if many results are returned.

Filtering would allow users to better organize or search the results.

Export functionality would allow the results to be used outside the NetBox environment (i.e. emailed to users to correct certain modeling mistakes).

Database changes

None

External dependencies

None

atownson avatar Oct 06 '22 13:10 atownson

Some of this will be covered when I finish job scheduling:

https://github.com/netbox-community/netbox/pull/10417

However probably not exactly you describe it. I actually have a hard time visualising exactly what you are suggesting, could you perhaps make some crude drawings?

kkthxbye-code avatar Oct 06 '22 14:10 kkthxbye-code

@kkthxbye-code, here's an illustration for Scripts: image

atownson avatar Oct 06 '22 16:10 atownson

@kkthxbye-code, here's an illustration for Reports: image

atownson avatar Oct 06 '22 16:10 atownson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

github-actions[bot] avatar Dec 06 '22 04:12 github-actions[bot]

Related: #9376

jeremystretch avatar Dec 27 '22 14:12 jeremystretch

@atownson since you are working in scripts, maybe some kind of "script hook" could be a nice feature. That way the user can setup a script to be runned when something changes in Netbox

renatoalmeidaoliveira avatar Feb 03 '23 17:02 renatoalmeidaoliveira

Great idea! @renatoalmeidaoliveira I just opened FR #11827 for this.

jeremystretch avatar Mar 02 '23 14:03 jeremystretch

pushed to 3.6 milestone

ryanmerolle avatar Mar 23 '23 15:03 ryanmerolle

👋 would love to be able to filter reports on the UI based on level (or any other row heading really) e.g., running a report on this many devices:

image

is hard to get value out of the results due to so many devices on a single page. Would love to filter these

lucasalvatore avatar Jul 25 '23 19:07 lucasalvatore