script_result.html 1.7 KB

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