netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Display Script Results Instead of Job Logs

Open bitcollector1 opened this issue 1 year ago • 3 comments
trafficstars

NetBox version

v4.0.0

Feature type

Restore functionality back to the way it was prior to NetBox 4.0; so you can get a link back to the results, from the list of jobs.

Proposed functionality

From the list of completed jobs, provide link to the script "results" page instead of the jobs "logs" page.

Screenshot 2024-05-06 at 18 09 14

Script Results: (right after the script runs) Screenshot 2024-05-06 at 18 10 51

Job Log: (Prior to NetBox 4.0 clicking on the "Name" would bring you to the results page. Now both "ID" and "Name" bring you to log page. Screenshot 2024-05-06 at 18 12 57

Use case

Restore functionality back to the way it was prior to NetBox 4.0; so you can get a link back to the results.

Change this link: /core/jobs/41699/

to this: /extras/scripts/results/41699/

It's much easier to read the results with all the formatting and color coding.

Database changes

No response

External dependencies

No response

bitcollector1 avatar May 07 '24 01:05 bitcollector1

Thanks for taking this up @abhi1693

bitcollector1 avatar May 09 '24 14:05 bitcollector1

Just wanted to confirm that this adds a new column for the "results" to the main jobs page. /core/jobs/

I'm trying to follow along and it looks like the results are only showing up here: /extras/scripts/ID/jobs/

I use the main jobs page the most to navigate all the various jobs and to view the results.

looks like there are a couple of jobs tables and it took me a minute to figure out why I was not seeing the changes when I implemented the code proposed.

bitcollector1 avatar May 09 '24 20:05 bitcollector1

@bitcollector1 we can't add a "result" column to the generic jobs list as not all jobs reference a result (those are only for scripts).

jeremystretch avatar May 14 '24 11:05 jeremystretch

To add on to this...it doesn't appear adding an object to logs references the object anymore. self.log_info("example message",obj=Device.objects.get(serial=serial_no["sr_no"]))

image

Mailstorm-ctrl avatar Jun 06 '24 20:06 Mailstorm-ctrl

There is a very similar issue with the results of a report. The object name and URL are shown as 2 separate columns which is hard to read. I suggest hiding the URL column and making it a hyperlink on the name. I think this is how it worked in v3, but I'm not positive. The spirit of this change is the same for both, but let me know if this should be a separate issue.

image

llamafilm avatar Jun 22 '24 04:06 llamafilm

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 Sep 21 '24 04:09 github-actions[bot]

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

github-actions[bot] avatar Oct 24 '24 04:10 github-actions[bot]