From 9813f3b696417729603646b1192d93c0d8eda7ec Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 26 Aug 2021 15:04:24 -0400 Subject: [PATCH] Clean up custom script templates --- netbox/templates/extras/script.html | 6 +- netbox/templates/extras/script_result.html | 192 +++++++++++---------- 2 files changed, 104 insertions(+), 94 deletions(-) diff --git a/netbox/templates/extras/script.html b/netbox/templates/extras/script.html index 6187e6f71..38f82fe03 100644 --- a/netbox/templates/extras/script.html +++ b/netbox/templates/extras/script.html @@ -40,9 +40,11 @@ {% endif %}
{% csrf_token %} -
+
{% if form.requires_input %} -

Script Data

+
+
Script Data
+
{% else %}
diff --git a/netbox/templates/extras/script_result.html b/netbox/templates/extras/script_result.html index 78d67e6ac..59ca8a69d 100644 --- a/netbox/templates/extras/script_result.html +++ b/netbox/templates/extras/script_result.html @@ -4,105 +4,113 @@ {% load log_levels %} {% load static %} -{% block title %}{{ script }} {% include 'extras/inc/job_label.html' with result=result %}{% endblock %} - {% block head %} {% endblock %} -{% block content %} -
-
- -
-
-

{{ script.Meta.description|render_markdown }}

- -
-

- Run: {{ result.created|annotated_date }} - {% if result.completed %} - Duration: {{ result.duration }} - {% else %} -

- Loading... -
- {% endif %} -

-
- {% if result.completed %} -
-
-
-
- Script Log -
-
- - - - - - - {% for log in result.data.log %} - - - - - - {% empty %} - - - - {% endfor %} -
LineLevelMessage
{{ forloop.counter }}{% log_level log.status %}{{ log.message|render_markdown }}
- No log output -
-
- {% if execution_time %} - - {% endif %} -
-
-
- {% else %} -
-
-
Pending Results
-
-
- {% endif %} -
-
-
{{ result.data.output }}
-
-
-

{{ script.filename }}

-
{{ script.source }}
-
-
+{% block title %}{{ script }}{% endblock %} + +{% block subtitle %} + {{ script.Meta.description|render_markdown }} + {% include 'extras/inc/job_label.html' with result=result %} {% endblock %} +{% block header %} +
+
+ +
+
+ {{ block.super }} +{% endblock header %} + +{% block content-wrapper %} + +
+

+ Run: {{ result.created|annotated_date }} + {% if result.completed %} + Duration: {{ result.duration }} + {% else %} +

+ Loading... +
+ {% endif %} +

+
+ {% if result.completed %} +
+
+
+
+ Script Log +
+
+ + + + + + + {% for log in result.data.log %} + + + + + + {% empty %} + + + + {% endfor %} +
LineLevelMessage
{{ forloop.counter }}{% log_level log.status %}{{ log.message|render_markdown }}
+ No log output +
+
+ {% if execution_time %} + + {% endif %} +
+
+
+ {% else %} +
+
+
Pending Results
+
+
+ {% endif %} +
+
+
{{ result.data.output }}
+
+
+

{{ script.filename }}

+
{{ script.source }}
+
+
+{% endblock content-wrapper %} + {% block data %}