script_result.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {% load helpers %}
  2. {% load log_levels %}
  3. <p>
  4. Initiated: <strong>{{ result.created|annotated_date }}</strong>
  5. {% if result.completed %}
  6. Duration: <strong>{{ result.duration }}</strong>
  7. {% endif %}
  8. <span id="pending-result-label">{% include 'extras/inc/job_label.html' %}</span>
  9. </p>
  10. {% if result.completed %}
  11. <div class="card mb-3">
  12. <h5 class="card-header">Script Log</h5>
  13. <div class="card-body">
  14. <table class="table table-hover panel-body">
  15. <tr>
  16. <th>Line</th>
  17. <th>Level</th>
  18. <th>Message</th>
  19. </tr>
  20. {% for log in result.data.log %}
  21. <tr>
  22. <td>{{ forloop.counter }}</td>
  23. <td>{% log_level log.status %}</td>
  24. <td class="rendered-markdown">{{ log.message|render_markdown }}</td>
  25. </tr>
  26. {% empty %}
  27. <tr>
  28. <td colspan="3" class="text-center text-muted">
  29. No log output
  30. </td>
  31. </tr>
  32. {% endfor %}
  33. </table>
  34. </div>
  35. {% if execution_time %}
  36. <div class="card-footer text-end text-muted">
  37. <small>Exec Time: {{ execution_time|floatformat:3 }}s</small>
  38. </div>
  39. {% endif %}
  40. </div>
  41. <h4>Output</h4>
  42. {% if result.data.output %}
  43. <pre class="block">{{ result.data.output }}</pre>
  44. {% else %}
  45. <p class="text-muted">None</p>
  46. {% endif %}
  47. {% else %}
  48. {% include 'extras/inc/result_pending.html' %}
  49. {% endif %}