webcron/templates/job/view.html.twig

44 lines
2.3 KiB
Twig

{% extends "base.html.twig" %}
{% block title %}Overview of run for {{ job.name }}{% endblock %}
{% block content %}
<h2>Overview of runs for <span class="job-name">{{ job.name | parsetags | raw }}</span></h2>
<p>
<a href="{{ path('job_edit', { id: job.id }) }}">Edit job</a>
{% if allruns %} | <a href="{{ path('job_view', { id: job.id })}}">Only show failed runs</a>
{% elseif not allruns %} | <a href="{{ path('job_view', { id: job.id, all: 'all' })}}">Show all runs</a>
{% endif %}
</p>
<div id="runs" class="accordion">
{% for run in runs %}
<div class="accordion-item">
<div class="accordion-header" id="run-{{ run.id }}-header">
<button class="accordion-button{% if loop.index != 1 %} collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#run-{{ run.id }}" aria-expanded="{% if loop.index != 1 %}true{% else %}false{% endif %}" aria-controls="run-{{ run.id }}">
<div>
<div class="d-md-inline d-block text-left">{{ run.timestamp | date("d/m/Y H:i:s") }}</div>
<div class="d-md-inline d-block text-left">(exit code: {{ run.exitcode }} | runtime: {{ run.runtime | interval }})</div>
{% if 'M' in run.flags %}
<div class="d-md-inline d-block text-left">Manual Run</div>
{% endif %}
</div>
</button>
</div>
<div id="run-{{ run.id }}" class="accordion-collapse collapse{% if loop.index == 1%} show{% endif %}" aria-labelledby="run-{{ run.id }}-header" data-bs-parent="#runs">
<div class="accordion-body">
<pre>{{ run.output }}</pre>
</div>
</div>
</div>
{% else %}
<h4>No {% if not allruns %}failed {% endif %}runs found</h4>
<p><a href="{{ path('job_view', { id: job.id, all: 'all' })}}">Show all runs</a></p>
{% endfor %}
</div>
{% endblock %}
{% block styles %}
{{ vite_entry_link_tags('job.view') }}
{% endblock %}
{% block scripts %}
{{ vite_entry_script_tags('job.view') }}
{% endblock %}