1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/storages/templates/create_stg_vol_block.html
catborise 50fa42181b fix(ui): the settings index stays at hand on a phone; one wording in Turkish
On a phone the settings page opened with its group index on seven lines, and
the index was gone once the page, nine screens long, was scrolled. Below the lg
breakpoint it is now one row that scrolls sideways and sticks under the navbar
(navbar_height.js gives what sticks the navbar's height, which differs between
themes and grows when the phone menu opens).

Turkish said "VM" in 65 messages and "sanal makine" everywhere else; it now
says "sanal makine" throughout. Headings and buttons that still capitalised
every word follow the panel's sentence case, in English too (Change password,
SSH keys, Power off, ...). Wrong translations fixed: a password that is set
read as the command "Ayarla", the firmware setting was called a chip type,
Create flavor said Create user, the console viewport setting was called a port,
a DRBD typo, and host and interface are sunucu and arabirim as on every page.
A group's save button reads "Kaydet: <group>".
2026-11-22 16:43:34 +03:00

111 lines
8.1 KiB
HTML

{% load i18n %}
{% load operations %}
{% load django_bootstrap5 %}
{% load bootstrap_icons %}
{% if request.user.is_superuser %}
{% if state != 0 %}
{% if pool == "iso" %}
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#IsoUpload">
<span aria-hidden="true">{% bs_icon 'upload' %}</span> {% trans "Upload ISO" %}
</button>
<div class="modal fade" id="IsoUpload" tabindex="-1" role="dialog" aria-labelledby="IsoUploadLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="IsoUploadLabel">{% trans "Upload ISO image" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
</div>
<form id="isoUploadForm" action="{% url 'storage' compute.id pool %}" enctype="multipart/form-data" method="post" aria-label="{% trans "Upload iso form" %}"
data-no-file="{% trans 'Please select a file to upload.' %}" data-not-iso="{% trans 'Only .iso files can be uploaded.' %}"
data-empty="{% trans 'The selected file is empty.' %}" data-starting="{% trans 'Starting upload...' %}"
data-uploading="{% trans 'Uploading; the job panel shows its progress. Stay on this page until it ends.' %}"
data-retrying="{% trans 'Retrying upload...' %}" data-failed="{% trans 'An error occurred during upload.' %}">{% csrf_token %}
<div class="modal-body">
<label for="id_file" class="form-label">{% trans "ISO file" %}</label>
<input type="file" name="file" id="id_file" class="form-control" accept=".iso" required aria-describedby="id_file_help">
<div class="form-text" id="id_file_help">{% trans "The browser sends it: keep the page open until the upload ends." %}</div>
<div id="upload-status" class="d-none align-items-center gap-2 text-primary mt-3" role="status" aria-live="polite">
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
<span id="upload-status-text">{% trans "Starting upload..." %}</span>
</div>
<div id="upload-error-message" class="alert alert-danger mt-3 d-none" role="alert"></div>
</div>
<div class="modal-footer">
<input type="hidden" name="iso_upload" value="true">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="submit" class="btn btn-primary">{% trans "Upload" %}</button>
</div>
</form>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% else %}
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#AddImage">
<span aria-hidden="true">{% bs_icon 'plus-lg' %}</span> {% trans "New volume" %}
</button>
<div class="modal fade" id="AddImage" tabindex="-1" role="dialog" aria-labelledby="AddImageLabel" aria-hidden="true"
{% if form.errors %}data-open{% endif %}>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AddImageLabel">{% trans "New volume" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
</div>
<div class="modal-body">
<form id="create-volume" method="post" aria-label="{% trans "Create volume to storage form" %}">
{% csrf_token %}
<div class="row">
<div class="col-12">{% bootstrap_field form.name %}</div>
<div class="col-sm-6">{% bootstrap_field form.size %}</div>
<div class="col-sm-6">{% bootstrap_field form.format %}</div>
<div class="col-12">{% bootstrap_field form.meta_prealloc %}</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="submit" form="create-volume" class="btn btn-primary" name="create_volume">{% trans "Create" %}</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% endif %}
{% if type == "dir" or type == "fs" or type == "netfs" %}
{# the worker downloads it into the pool; the job panel shows its progress #}
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal" data-bs-target="#FetchVolume">
<span aria-hidden="true">{% bs_icon 'download' %}</span> {% trans "Download from a URL" %}
</button>
<div class="modal fade" id="FetchVolume" tabindex="-1" aria-labelledby="FetchVolumeLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="FetchVolumeLabel">{% trans "Download from a URL" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
</div>
<form method="post" aria-labelledby="FetchVolumeLabel">{% csrf_token %}{% submission_key %}
<div class="modal-body">
<div class="mb-3">
<label class="form-label" for="fetch-url">{% trans "Address" %}</label>
<input type="url" class="form-control" name="url" id="fetch-url" required placeholder="https://" aria-describedby="fetch-url-help">
<div class="form-text" id="fetch-url-help">{% trans "An ISO or a disk image (qcow2, raw) at an http or https address that tells its size. The panel's host downloads it." %}</div>
</div>
<div>
<label class="form-label" for="fetch-name">{% trans "Volume name" %}</label>
<input type="text" class="form-control" name="name" id="fetch-name" pattern="[a-zA-Z0-9\.\-_]+" aria-describedby="fetch-name-help">
<div class="form-text" id="fetch-name-help">{% trans "Empty: the file's name in the address. An ISO keeps its .iso ending, or VMs do not list it as media." %}</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="submit" class="btn btn-primary" name="fetch_volume" value="1">{% trans "Download" %}</button>
</div>
</form>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endif %}