1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00
webvirtcloud/vmbackups/templates/vmbackups/policy.html
catborise a145c07601 feat(vmbackups): the Schedules pages
Backups -> Schedules lists the backup schedules and adds one: a name, a
target, every VM of a compute or chosen VMs (a searchable list), a
daily time in the panel's time zone (the form names it), how many
backups of each VM to keep, Require frozen file systems, Enabled. The
VMs' hosts must have a pool of the target. The superuser who saves a
schedule is its owner, whom its jobs run as. A schedule's page edits or
deletes it (its backups are kept) and lists its runs: the backup job,
or why the day's backup was skipped or failed.

The Backups page has a Schedule column (or By hand) and a Missing state;
a missing backup offers no Restore. A VM's Backups tab names the
schedules that cover it. README: a paragraph on schedules.

A target with schedules is not deleted: its page says to delete them
first.
2026-11-17 11:38:35 +03:00

55 lines
2.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% 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">{% trans run.note %}</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 %}