From 0c214d37b31118a042f96fe1671f26220f379efb Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 8 Feb 2024 10:32:39 -0800 Subject: [PATCH] 14438 fix merge --- netbox/templates/extras/script_list.html | 130 +++++++++++------------ 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html index b4c6a0519..251d4d43c 100644 --- a/netbox/templates/extras/script_list.html +++ b/netbox/templates/extras/script_list.html @@ -44,75 +44,73 @@ - {% with jobs=module.get_latest_jobs %} - {% for script_name, script in module.scripts.items %} - {% with last_job=jobs|get_key:script.class_name %} - - - {{ script.name }} - - {{ script.description|markdown|placeholder }} - {% if last_job %} - - {{ last_job.created|annotated_date }} - - - {% badge last_job.get_status_display last_job.get_status_color %} - - {% else %} - {% trans "Never" %} - {{ ''|placeholder }} - {% endif %} - - {% if perms.extras.run_script %} -
-
- {% csrf_token %} - -
-
- {% endif %} - - + {% for script in module.scripts.all %} + {% with last_job=script.get_latest_jobs|get_key:script.name %} + + + {{ script.name }} + + {{ script.description|markdown|placeholder }} {% if last_job %} - {% for test_name, data in last_job.data.tests.items %} - - - {{ test_name }} - - - {{ data.success }} - {{ data.info }} - {{ data.warning }} - {{ data.failure }} - - - {% endfor %} - {% elif not last_job.data.log %} - {# legacy #} - {% for method, stats in last_job.data.items %} - - - {{ method }} - - - {{ stats.success }} - {{ stats.info }} - {{ stats.warning }} - {{ stats.failure }} - - - {% endfor %} + + {{ last_job.created|annotated_date }} + + + {% badge last_job.get_status_display last_job.get_status_color %} + + {% else %} + {% trans "Never" %} + {{ ''|placeholder }} {% endif %} - {% endwith %} + + {% if perms.extras.run_script %} +
+
+ {% csrf_token %} + +
+
+ {% endif %} + + + {% if last_job %} + {% for test_name, data in last_job.data.tests.items %} + + + {{ test_name }} + + + {{ data.success }} + {{ data.info }} + {{ data.warning }} + {{ data.failure }} + + + {% endfor %} + {% elif not last_job.data.log %} + {# legacy #} + {% for method, stats in last_job.data.items %} + + + {{ method }} + + + {{ stats.success }} + {{ stats.info }} + {{ stats.warning }} + {{ stats.failure }} + + + {% endfor %} + {% endif %} + {% endwith %} {% endfor %} - {% endwith %} {% else %}