diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html index 448de2c8d..b4c6a0519 100644 --- a/netbox/templates/extras/script_list.html +++ b/netbox/templates/extras/script_list.html @@ -20,6 +20,7 @@ {% block content %} {% for module in script_modules %} + {% include 'inc/sync_warning.html' with object=module %}
@@ -31,97 +32,96 @@ {% endif %}
-
- {% include 'inc/sync_warning.html' with object=module %} - {% if module.scripts %} - - - - - - - - - - - - {% with jobs=module.get_latest_jobs %} - {% for script_name, script in module.scripts.items %} - {% with last_job=jobs|get_key:script.class_name %} - + {% if module.scripts %} +
{% trans "Name" %}{% trans "Description" %}{% trans "Last Run" %}{% trans "Status" %}
+ + + + + + + + + + + {% with jobs=module.get_latest_jobs %} + {% for script_name, script in module.scripts.items %} + {% with last_job=jobs|get_key:script.class_name %} + + + + {% if last_job %} - - {% if last_job %} - - - {% else %} - - - {% endif %} - - {% if last_job.data.logs %} - {% for method, stats in last_job.data.logs.items %} - - - - - {% endfor %} - {% elif not last_job.data.log %} - {# legacy #} - {% for method, stats in last_job.data.items %} - - - - - {% endfor %} + {% else %} + + {% endif %} - {% endwith %} - {% endfor %} - {% endwith %} - -
{% trans "Name" %}{% trans "Description" %}{% trans "Last Run" %}{% trans "Status" %}
+ {{ script.name }} + {{ script.description|markdown|placeholder }} - {{ script.name }} + {{ last_job.created|annotated_date }} {{ script.description|markdown|placeholder }} - {{ last_job.created|annotated_date }} - - {% badge last_job.get_status_display last_job.get_status_color %} - {% trans "Never" %}{{ ''|placeholder }} - {% if perms.extras.run_script %} -
-
- {% csrf_token %} - -
-
- {% endif %} + {% badge last_job.get_status_display last_job.get_status_color %}
- {{ method }} - - {{ stats.success }} - {{ stats.info }} - {{ stats.warning }} - {{ stats.failure }} -
- {{ method }} - - {{ stats.success }} - {{ stats.info }} - {{ stats.warning }} - {{ stats.failure }} -
{% trans "Never" %}{{ ''|placeholder }}
- {% else %} + + {% 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 %} +
- {% endif %} -
+
+ {% endif %}
{% empty %}