mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 01:16:10 +00:00
- binary_size filter (common_tags): every size on the pages is B/KiB/MiB/GiB/TiB with the language's decimal mark; Django's filesizeformat said GB for GiB, so a page showed "512,0 MB / 3,8 GB" beside "0,4 / 3,8 GiB" and a disk "20,0 GB" next to a GiB field - percent filter and Intl percent in charts.js, the job panel and the new-VM dialog: 13% in English, %13 in Turkish (pages had "13 %", "%11" and "13%") - the Jobs page and panel say in whole sentences that the job worker is not running and that jobs wait for it, instead of a sentence glued to a date - job state badges start with a capital, as the VM state badges (CSS, so the label stays lowercase inside sentences) - profile card shows the username under the name only when there is a full name - Turkish: hostname, revert snapshot, snapshot count, API token and worker texts
65 lines
4.2 KiB
HTML
65 lines
4.2 KiB
HTML
{% load i18n %}
|
||
{% load common_tags %}
|
||
{% load operations %}
|
||
{% load bootstrap_icons %}
|
||
{% load static %}
|
||
<div class="tab-pane" id="backups" role="tabpanel">
|
||
<div class="card">
|
||
<div class="card-body">
|
||
{% if backups.problem %}
|
||
<div class="alert alert-warning" role="status">{% bs_icon 'exclamation-triangle' %} {{ backups.problem }}</div>
|
||
{% else %}
|
||
<form action="{% url 'vmbackups:create' instance.id %}" method="post" aria-label="{% trans "Back up now" %}">{% csrf_token %}{% submission_key %}
|
||
<div class="row g-2 align-items-center">
|
||
<div class="col-12 col-md">
|
||
<label class="visually-hidden" for="backup-target">{% trans "Backup target" %}</label>
|
||
<select class="form-select" id="backup-target" name="target" required>
|
||
{% for target in backups.targets %}<option value="{{ target.id }}">{{ target.name }}</option>{% endfor %}
|
||
</select>
|
||
</div>
|
||
<div class="col-12 col-md-auto">
|
||
<div class="form-check">
|
||
<input class="form-check-input" type="checkbox" name="frozen" id="backup-frozen"{% if instance.status != 1 or not instance.guest_agent_ready %} disabled{% endif %}>
|
||
<label class="form-check-label" for="backup-frozen">{% trans "Require frozen file systems" %}</label>
|
||
</div>
|
||
</div>
|
||
<div class="col-12 col-md-auto d-grid">
|
||
<button type="submit" class="btn btn-primary">{% bs_icon 'archive' %} {% trans "Back up now" %}</button>
|
||
</div>
|
||
</div>
|
||
<p class="small text-body-secondary mt-2 mb-0">{% blocktrans %}A running VM keeps running: its disks are copied from one instant, its file systems frozen for that instant when the guest agent answers, otherwise the backup is crash-consistent. Memory is not kept.{% endblocktrans %}</p>
|
||
</form>
|
||
{% endif %}
|
||
|
||
{% if backups.schedules %}
|
||
<p class="small mt-3 mb-0">{% trans "Schedules:" %}
|
||
{% for policy in backups.schedules %}<a href="{% url 'vmbackups:policy' policy.id %}">{{ policy.name }}</a> ({{ policy.time|time:"H:i" }}){% if not policy.enabled %} <span class="badge text-bg-secondary">{% trans "Disabled" %}</span>{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}
|
||
</p>
|
||
{% endif %}
|
||
{% if backups.rows %}
|
||
<div class="table-responsive mt-3">
|
||
<table class="table table-sm align-middle mb-0">
|
||
<thead>
|
||
<tr><th>{% trans "Time" %}</th><th class="d-none d-md-table-cell">{% trans "Target" %}</th><th class="d-none d-sm-table-cell">{% trans "Consistency" %}</th><th class="text-end d-none d-sm-table-cell">{% trans "Size" %}</th><th>{% trans "State" %}</th><th></th></tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for backup in backups.rows %}
|
||
<tr>
|
||
<td class="text-nowrap">{{ backup.created_at|date:"Y-m-d H:i" }}</td>
|
||
<td class="d-none d-md-table-cell">{{ backup.target.name }}</td>
|
||
<td class="d-none d-sm-table-cell">{% include "vmbackups/consistency.html" %}</td>
|
||
<td class="text-end text-nowrap d-none d-sm-table-cell">{% if backup.size %}{{ backup.size|binary_size }}{% else %}–{% endif %}</td>
|
||
<td>{% include "vmbackups/state.html" with pending_deletes=backups.pending_deletes %}</td>
|
||
<td class="text-end">{% include "vmbackups/delete_form.html" with pending_deletes=backups.pending_deletes %}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<p class="text-body-secondary mt-3 mb-0">{% trans "No backup of this VM yet." %}</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script src="{% static 'vmbackups/pending.js' %}"></script>
|