Display Script Results Instead of Job Logs #9597

Closed
opened 2025-12-29 21:19:28 +01:00 by adam · 7 comments
Owner

Originally created by @bitcollector1 on GitHub (May 7, 2024).

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

Originally created by @bitcollector1 on GitHub (May 7, 2024). ### 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. <img width="1302" alt="Screenshot 2024-05-06 at 18 09 14" src="https://github.com/netbox-community/netbox/assets/50723251/a61a2ff4-1575-4791-b5b1-b0bb9d892a5f"> Script Results: (right after the script runs) <img width="1191" alt="Screenshot 2024-05-06 at 18 10 51" src="https://github.com/netbox-community/netbox/assets/50723251/4daa3d92-a9b5-4ebe-aac6-2085b7e6fe36"> 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. <img width="1155" alt="Screenshot 2024-05-06 at 18 12 57" src="https://github.com/netbox-community/netbox/assets/50723251/e1807509-76b0-4059-b2bf-fec3cfa96b53"> ### 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_
adam closed this issue 2025-12-29 21:19:28 +01:00
Author
Owner

@bitcollector1 commented on GitHub (May 9, 2024):

Thanks for taking this up @abhi1693

@bitcollector1 commented on GitHub (May 9, 2024): Thanks for taking this up @abhi1693
Author
Owner

@bitcollector1 commented on GitHub (May 9, 2024):

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 commented on GitHub (May 9, 2024): 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.
Author
Owner

@jeremystretch commented on GitHub (May 14, 2024):

@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 commented on GitHub (May 14, 2024): @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).
Author
Owner

@Mailstorm-ctrl commented on GitHub (Jun 6, 2024):

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 commented on GitHub (Jun 6, 2024): 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](https://github.com/netbox-community/netbox/assets/53045430/434a78f3-2ff3-4ad7-b323-7f6f7856b516)
Author
Owner

@llamafilm commented on GitHub (Jun 22, 2024):

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 commented on GitHub (Jun 22, 2024): 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. <img width="1181" alt="image" src="https://github.com/netbox-community/netbox/assets/3991046/fd4c1a16-df4d-40e2-93c8-0a3f05698722">
Author
Owner

@github-actions[bot] commented on GitHub (Sep 21, 2024):

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] commented on GitHub (Sep 21, 2024): 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](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2024):

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] commented on GitHub (Oct 24, 2024): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9597