From 6f3dfbabeee525d19f6275df1e11b0920bbeb124 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Thu, 9 May 2024 23:02:36 +0530 Subject: [PATCH] adds extra column for result on the script job table #15983 --- netbox/extras/views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netbox/extras/views.py b/netbox/extras/views.py index ff147cc31..53b831002 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -17,6 +17,7 @@ from dcim.models import Device, DeviceRole, Platform from extras.dashboard.forms import DashboardWidgetAddForm, DashboardWidgetForm from extras.dashboard.utils import get_widget_class from netbox.constants import DEFAULT_ACTION_PERMISSIONS +from netbox.tables import columns from netbox.views import generic from netbox.views.generic.mixins import TableMixin from utilities.data import shallow_compare_dict @@ -1126,9 +1127,15 @@ class ScriptJobsView(generic.ObjectView): jobs_table = JobTable( data=script.jobs.all(), orderable=False, - user=request.user + user=request.user, + extra_columns=[( + 'result', columns.TemplateColumn( + template_code='{{ record.completed }}' + ) + ),] ) jobs_table.configure(request) + jobs_table.columns.show('result') return render(request, 'extras/script/jobs.html', { 'script': script,