mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 04:36:48 +00:00
libvirt's backup copies the disks of a running or paused VM from one instant into new volumes while it keeps running; the clone is defined shut off as before. The VM is held for the copy, the copy can be cancelled, and recovery reads the job's records and libvirt.
105 lines
5.5 KiB
HTML
105 lines
5.5 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
{% load bootstrap_icons %}
|
|
{% load operations %}
|
|
|
|
{% block title %}{{ job.label }}{% endblock %}
|
|
|
|
{% block page_heading %}{{ job.label }}{% endblock page_heading %}
|
|
|
|
{% block page_heading_extra %}
|
|
<div class="d-flex gap-2">
|
|
{% if job.cancellable %}
|
|
<form method="post" action="{% url 'operations:cancel' job.id %}" aria-label="{% trans 'Cancel job form' %}">
|
|
{% csrf_token %}
|
|
<button class="btn btn-warning" type="submit">{% trans "Cancel" %}</button>
|
|
</form>
|
|
{% endif %}
|
|
<a class="btn btn-outline-secondary" href="{% url 'operations:jobs' %}">{% trans "Jobs" %}</a>
|
|
</div>
|
|
{% endblock page_heading_extra %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
{% if op.error %}
|
|
<div class="alert alert-{{ op.state|state_color }}" role="alert">
|
|
{% bs_icon 'exclamation-triangle' %} {{ op.error }}
|
|
</div>
|
|
{% endif %}
|
|
<dl class="row">
|
|
<dt class="col-sm-3">{% trans "Resource" %}</dt><dd class="col-sm-9 text-break">{{ job.resource_label }}</dd>
|
|
<dt class="col-sm-3">{% trans "User" %}</dt><dd class="col-sm-9">{{ job.username }}</dd>
|
|
<dt class="col-sm-3">{% trans "State" %}</dt>
|
|
<dd class="col-sm-9">{% include "operations/state_badge.html" with state=op.state %}</dd>
|
|
{% if op.phase %}<dt class="col-sm-3">{% trans "Phase" %}</dt><dd class="col-sm-9">{% translate op.phase %}</dd>{% endif %}
|
|
{% if op.progress_total %}
|
|
{% widthratio op.progress_done|default:0 op.progress_total 100 as percent %}
|
|
<dt class="col-sm-3">{% trans "Progress" %}</dt>
|
|
<dd class="col-sm-9">
|
|
<div class="progress mb-1" role="progressbar" aria-label="{% trans 'Progress' %}" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100">
|
|
<div class="progress-bar" style="width: {{ percent }}%">{{ percent }}%</div>
|
|
</div>
|
|
<span class="small text-body-secondary">
|
|
{% if progress_bytes %}{{ op.progress_done|default:0|filesizeformat }} / {{ op.progress_total|filesizeformat }}{% else %}{{ op.progress_done|default:0 }} / {{ op.progress_total }}{% endif %}
|
|
</span>
|
|
</dd>
|
|
{% endif %}
|
|
<dt class="col-sm-3">{% trans "Created" %}</dt><dd class="col-sm-9">{{ op.created_at|date:"M d H:i:s" }}</dd>
|
|
{% if op.started_at %}<dt class="col-sm-3">{% trans "Started" %}</dt><dd class="col-sm-9">{{ op.started_at|date:"M d H:i:s" }}</dd>{% endif %}
|
|
{% if op.finished_at %}<dt class="col-sm-3">{% trans "Finished" %}</dt><dd class="col-sm-9">{{ op.finished_at|date:"M d H:i:s" }}</dd>{% endif %}
|
|
{% if job.result.left_behind %}
|
|
<dt class="col-sm-3">{% trans "Left behind" %}</dt>
|
|
<dd class="col-sm-9">
|
|
<ul class="list-unstyled mb-0">
|
|
{% for item in job.result.left_behind %}<li class="text-break"><code>{{ item }}</code></li>{% endfor %}
|
|
</ul>
|
|
</dd>
|
|
{% endif %}
|
|
{% if job.result.warning %}
|
|
<dt class="col-sm-3">{% trans "Warning" %}</dt><dd class="col-sm-9 text-break">{{ job.result.warning }}</dd>
|
|
{% endif %}
|
|
{% if job.result.links %}
|
|
<dt class="col-sm-3">{% trans "Results" %}</dt>
|
|
<dd class="col-sm-9">
|
|
<ul class="list-unstyled mb-0">
|
|
{% for link in job.result.links %}<li><a href="{{ link.url }}">{{ link.label }}</a></li>{% endfor %}
|
|
</ul>
|
|
</dd>
|
|
{% endif %}
|
|
{% if job.resolution %}
|
|
<dt class="col-sm-3">{% trans "Resolution" %}</dt>
|
|
<dd class="col-sm-9">{{ job.resolution|state_label }}: {{ job.resolution_note }}</dd>
|
|
{% endif %}
|
|
</dl>
|
|
|
|
{% if request.user.is_superuser and op.state == "uncertain" %}
|
|
<h5 class="mt-4">{% trans "Resolve" %}</h5>
|
|
<form method="post" action="{% url 'operations:resolve' job.id %}" aria-label="{% trans 'Resolve job form' %}">
|
|
{% csrf_token %}
|
|
<div class="row mb-3">
|
|
<label class="col-sm-3 col-form-label" for="resolve-outcome">{% trans "Outcome" %}</label>
|
|
<div class="col-sm-9">
|
|
<select class="form-select" name="outcome" id="resolve-outcome">
|
|
<option value="succeeded">{% trans "Succeeded" %}</option>
|
|
<option value="failed">{% trans "Failed" %}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row mb-3">
|
|
<label class="col-sm-3 col-form-label" for="resolve-note">{% trans "Note" %}</label>
|
|
<div class="col-sm-9">
|
|
<textarea class="form-control" name="note" id="resolve-note" rows="3" required placeholder="{% trans 'What was checked' %}"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="text-end">
|
|
<button class="btn btn-primary" type="submit">{% trans "Resolve" %}</button>
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block script %}
|
|
{% if follow %}{% include "operations/follow_active.html" %}{% endif %}
|
|
{% endblock script %}
|