mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 01:16:10 +00:00
A failed run kept the error as English text and the schedule page passed the whole sentence to gettext, which found no catalog entry once values were filled in. The run now keeps the error as messages (text and values), as jobs do, and the page shows them with the new words filter.
56 lines
2.9 KiB
HTML
56 lines
2.9 KiB
HTML
{% extends "base.html" %}
|
||
{% load i18n %}
|
||
{% load static %}
|
||
{% load bootstrap_icons %}
|
||
{% load operations %}
|
||
|
||
{% block title %}{{ policy.name }} - {% trans "Backup schedules" %}{% endblock %}
|
||
{% block style %}<link href="{% static 'css/tom-select.bootstrap5.min.css' %}" rel="stylesheet">{% endblock %}
|
||
|
||
{% block page_heading %}<a href="{% url 'vmbackups:policies' %}">{% trans "Schedules" %}</a> / {{ policy.name }}{% endblock page_heading %}
|
||
|
||
{% block content %}
|
||
<p class="text-body-secondary">{% blocktrans with owner=policy.owner.username|default:"–" %}Its jobs run as {{ owner }}, who saved it last.{% endblocktrans %}</p>
|
||
<div class="row g-4">
|
||
<div class="col-lg-6">
|
||
<div class="card">
|
||
<div class="card-body">{% include "vmbackups/policy_form.html" %}</div>
|
||
</div>
|
||
<form method="post" class="mt-3">
|
||
{% csrf_token %}
|
||
<button type="submit" name="delete" value="1" class="btn btn-outline-danger"
|
||
data-confirm="{% trans "Delete this schedule? Its backups are kept." %}">{% bs_icon 'trash' %} {% trans "Delete schedule" %}</button>
|
||
</form>
|
||
</div>
|
||
<div class="col-lg-6">
|
||
<h2 class="h6">{% trans "Runs" %}</h2>
|
||
{% if runs %}
|
||
<div class="table-responsive">
|
||
<table class="table table-sm align-middle">
|
||
<thead><tr><th>{% trans "Day" %}</th><th>{% trans "VM" %}</th><th>{% trans "Result" %}</th></tr></thead>
|
||
<tbody>
|
||
{% for run in runs %}
|
||
<tr>
|
||
<td class="text-nowrap">{{ run.day|date:"Y-m-d" }}</td>
|
||
<td><a href="{% url 'instances:instance' run.instance_id %}">{{ run.instance.name }}</a></td>
|
||
<td>
|
||
{% if run.state == "submitted" %}{% if run.operation_id %}<a href="{% url 'operations:job' run.operation_id %}">{% trans "Backup job" %}</a>{% else %}{% trans "Started" %}{% endif %}
|
||
{% elif run.state == "skipped" %}<span class="badge text-bg-secondary">{% trans "Skipped" %}</span>
|
||
{% else %}<span class="badge text-bg-danger">{% trans "Failed" %}</span>{% endif %}
|
||
{% if run.note %}<div class="small text-body-secondary">{{ run.note|words }}</div>{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<p class="text-body-secondary">{% trans "No run yet." %}</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|
||
{% block script %}
|
||
<script src="{% static 'js/tom-select.complete.min.js' %}"></script>
|
||
<script src="{% static 'js/searchable_select.js' %}"></script>
|
||
{% endblock %}
|