1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/vmbackups/templates/vmbackups/policies.html
catborise 2c0855cf64 feat(backups): a schedule also keeps weekly and monthly backups
Besides the newest N backups of each VM, a schedule keeps the newest backup
of each of the last N weeks and of the last N months that have one (panel
time zone); 0 keeps none. The schedules list shows them.
2026-11-19 22:28:44 +03:00

39 lines
2.6 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% block title %}{% trans "Backup schedules" %}{% endblock %}
{% block page_heading %}<a href="{% url 'vmbackups:index' %}">{% trans "Backups" %}</a> / {% trans "Schedules" %}{% endblock page_heading %}
{% block page_heading_extra %}<a class="btn btn-primary btn-sm" href="{% url 'vmbackups:policy_new' %}">{% bs_icon 'plus' %} {% trans "New schedule" %}</a>{% endblock page_heading_extra %}
{% block content %}
{% if policies %}
<div class="table-responsive mb-4">
<table class="table table-hover align-middle">
<thead>
<tr><th>{% trans "Name" %}</th><th>{% trans "VMs" %}</th><th>{% trans "Target" %}</th><th>{% trans "Daily at" %}</th>
<th class="text-end">{% trans "Backups kept" %}</th><th>{% trans "Full backup" %}</th><th>{% trans "State" %}</th></tr>
</thead>
<tbody>
{% for policy in policies %}
<tr>
<td><a href="{% url 'vmbackups:policy' policy.id %}">{{ policy.name }}</a></td>
<td>{% if policy.compute %}{% blocktrans with compute=policy.compute.name %}Every VM of {{ compute }}{% endblocktrans %}{% elif policy.tag %}{% blocktrans with tag=policy.tag.name %}VMs tagged {{ tag }}{% endblocktrans %}{% else %}{% blocktrans count counter=policy.vm_count %}{{ counter }} VM{% plural %}{{ counter }} VMs{% endblocktrans %}{% endif %}</td>
<td>{{ policy.target.name }}</td>
<td>{{ policy.time|time:"H:i" }}</td>
<td class="text-end">{{ policy.keep }}{% if policy.keep_weekly %} {% blocktrans with n=policy.keep_weekly %}+ {{ n }} weekly{% endblocktrans %}{% endif %}{% if policy.keep_monthly %} {% blocktrans with n=policy.keep_monthly %}+ {{ n }} monthly{% endblocktrans %}{% endif %}</td>
<td>{% if policy.full_every == 1 %}{% trans "Every backup" %}{% else %}{% blocktrans with n=policy.full_every %}Every {{ n }} backups{% endblocktrans %}{% endif %}</td>
<td>{% if policy.enabled %}<span class="badge text-bg-success">{% trans "Enabled" %}</span>{% else %}<span class="badge text-bg-secondary">{% trans "Disabled" %}</span>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-info">{% trans "No backup schedule yet." %} {% trans "A schedule backs chosen VMs, or every VM of a compute, up every day and keeps the newest." %}</div>
{% endif %}
{% endblock %}