From a55316aef90957c12eae84c5e0298ca185427d12 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Wed, 21 Apr 2021 10:39:56 -0700 Subject: [PATCH] fix scripts/reports template layout --- netbox/templates/extras/report_result.html | 17 +- netbox/templates/extras/script_result.html | 196 +++++++++++---------- 2 files changed, 109 insertions(+), 104 deletions(-) diff --git a/netbox/templates/extras/report_result.html b/netbox/templates/extras/report_result.html index e64154979..a5210ecbe 100644 --- a/netbox/templates/extras/report_result.html +++ b/netbox/templates/extras/report_result.html @@ -2,11 +2,14 @@ {% load helpers %} {% load static %} -{% block title %}{{ report.name }} - {{ result.get_status_display }}{% endblock %} +{% block title %}{{ report.name }} {% include 'extras/inc/job_label.html' with result=result %}{% endblock %} + +{% block head %} + +{% endblock %} {% block content %} - -

@@ -18,7 +21,7 @@ Loading...

{% endif %} - {% include 'extras/inc/job_label.html' with result=result %} +

{% if result.completed %}
@@ -92,7 +95,7 @@
{% endblock %} -{% block javascript %} - +{% block data %} + + {% endblock %} diff --git a/netbox/templates/extras/script_result.html b/netbox/templates/extras/script_result.html index 1dc42cacc..9c126fbec 100644 --- a/netbox/templates/extras/script_result.html +++ b/netbox/templates/extras/script_result.html @@ -4,104 +4,106 @@ {% load log_levels %} {% load static %} -{% block title %}{{ script }} - {{ result.get_status_display }}{% endblock %} +{% block title %}{{ script }} {% include 'extras/inc/job_label.html' with result=result %}{% endblock %} -{% block content %} - - -
-
- -
-
-

{{ script.Meta.description|render_markdown }}

- -
-

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

- Loading... -
- {% endif %} - {% include 'extras/inc/job_label.html' with result=result %} -

-
- {% 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 %} - -{% block javascript %} +{% block head %} {% endblock %} + +{% block content %} +
+
+ +
+
+

{{ script.Meta.description|render_markdown }}

+ +
+

+ Run: {{ result.created }} + {% 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 %} + +{% block data %} + + +{% endblock %}