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_form.html
catborise 4881c3cd3e fix(ui): forms ask one thing at a time, offer the host's pools and say less twice
- A backup schedule asks Which VMs first (a compute's, chosen VMs or a
  tag's) and shows that one field only (policy_scope.js); the other two
  are not read, so a choice left in them is neither saved nor an error.
- A backup target's, a restore's and a disk restore's storage pool
  field offers the chosen compute's active file pools, the ones a
  restore copies into (a target's: directory and NFS only), from
  vmbackups.views.pools, which reads them without a refresh
  (pool_choices.js); a name can still be typed and is checked as before.
- A field's label is no longer repeated inside it as a placeholder, and
  a list's empty choice says Choose… instead of Django's dashes
  (webvirtcloud.bootstrap.FieldRenderer).
- The schedule, target, e-mail OTP and VM delete forms put Cancel and
  their main button at the right, as the other forms do.
2026-11-22 00:25:53 +03:00

31 lines
1.8 KiB
HTML

{% load i18n %}{% load django_bootstrap5 %}
<form method="post">
{% csrf_token %}
{% bootstrap_form_errors form type="non_fields" %}
{% bootstrap_field form.name %}
{% bootstrap_field form.target %}
{# one of the three, as Which VMs says; policy_scope.js shows its field only #}
<fieldset class="mb-3">
<legend class="form-label fs-6">{{ form.scope.label }}</legend>
{% bootstrap_field form.scope show_label=False wrapper_class="" %}
</fieldset>
<div data-scope="compute">{% bootstrap_field form.compute %}</div>
<div data-scope="instances">{% bootstrap_field form.instances %}</div>
<div data-scope="tag">{% bootstrap_field form.tag %}</div>
<div class="row g-2">
<div class="col-sm-6">{% blocktrans asvar zone_help %}Time zone: {{ time_zone }}{% endblocktrans %}{% bootstrap_field form.time help_text=zone_help %}</div>
<div class="col-sm-6">{% bootstrap_field form.full_every %}</div>
</div>
<div class="row g-2">
<div class="col-sm-4">{% bootstrap_field form.keep %}</div>
<div class="col-sm-4">{% bootstrap_field form.keep_weekly %}</div>
<div class="col-sm-4">{% bootstrap_field form.keep_monthly %}</div>
</div>
{% bootstrap_field form.frozen %}
{% bootstrap_field form.enabled %}
<p class="small text-body-secondary">{% trans "Each VM is backed up once a day, starting at the time; a VM that has not started within 6 hours waits for the next day. Older backups of each VM beyond those kept are deleted, a chain of incremental backups once all of it is beyond; backups taken by hand are not." %}</p>
<div class="d-flex justify-content-end gap-2">
<a class="btn btn-outline-secondary" href="{% url 'vmbackups:policies' %}">{% trans "Cancel" %}</a>
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
</div>
</form>