1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-26 16:15:25 +00:00
webvirtcloud/storages/templates/create_stg_block.html

258 lines
18 KiB
HTML
Raw Normal View History

2015-03-06 11:59:27 +00:00
{% load i18n %}
2015-03-03 09:34:09 +00:00
{% if request.user.is_superuser %}
<a href="#AddStgPool" type="button" class="btn btn-success float-end" data-bs-toggle="modal">
2020-05-19 16:53:54 +00:00
<span class="fa fa-plus" aria-hidden="true"></span>
2015-03-06 11:59:27 +00:00
</a>
<!-- Modal Storage pool -->
<div class="modal fade" id="AddStgPool" tabindex="-1" role="dialog" aria-labelledby="AddStgPoolLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
2020-05-19 16:53:54 +00:00
<h5 class="modal-title">{% trans "Create Storage Pool" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
2015-03-06 11:59:27 +00:00
</div>
<div class="modal-body">
2020-05-26 13:18:38 +00:00
<ul class="nav nav-tabs" aria-label="Storage create types">
<li class="nav-item" role="presentation">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#dirtab" type="button" role="tab" aria-controls="dirtab" aria-selected="true">
{% trans "DIR" %}
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#lvmtab" type="button" role="tab" aria-controls="lvmtab" aria-selected="false">
{% trans "LVM" %}
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cephtab" type="button" role="tab" aria-controls="cephtab" aria-selected="false">
{% trans "CEPH" %}
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#netfstab" type="button" role="tab" aria-controls="netfstab" aria-selected="false">
{% trans "NETFS" %}
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#isotab" type="button" role="tab" aria-controls="isotab" aria-selected="false">
{% trans "ISO" %}
</button>
2015-03-06 11:59:27 +00:00
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="dirtab">
<div class="modal-body">
<form method="post" action="" role="form" aria-label="Create storage with pool dir path form">{% csrf_token %}
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Type" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="stg_type" value="dir" disabled>
<input type="hidden" name="stg_type" value="dir">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="{% trans "default" %}" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Path" %}</label>
<div class="col-sm-6">
<input type="text" name="target" class="form-control" value="/var/lib/libvirt/images" required pattern="[a-zA-Z0-9\/\-_]+">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
</div>
</form>
2015-03-06 11:59:27 +00:00
</div>
<div class="tab-pane" id="lvmtab">
<div class="modal-body">
<form method="post" action="" role="form" aria-label="Create storage pool with LVM pool">{% csrf_token %}
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Type" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="stg_type" value="logical" disabled>
<input type="hidden" name="stg_type" value="logical">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="{% trans "default" %}" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Device" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="source" value="/dev/sdb" required pattern="[a-z0-9\/]+">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
</div>
</form>
2015-03-06 11:59:27 +00:00
</div>
<div class="tab-pane" id="cephtab">
<div class="modal-body">
<form method="post" action="" role="form" aria-label="Create storage pool with ceph form">{% csrf_token %}
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Type" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="stg_type" value="rbd" disabled>
<input type="hidden" name="stg_type" value="rbd">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="rbdpool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Ceph User" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="ceph_user" placeholder="libvirt" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Ceph Pool" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="ceph_pool" placeholder="libvirt-pool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Ceph Host" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="ceph_host" placeholder="mon0.ceph.host" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Secrets" %}</label>
<div class="col-sm-6">
<select name="secret" class="form-control">
{% if secrets %}
{% for secret in secrets %}
<option value="{{ secret }}">{{ secret }}</option>
{% endfor %}
{% else %}
<option value="None">{% trans "None" %}</option>
{% endif %}
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
{% if secrets %}
<button type="submit" class="btn btn-primary" name="create">
{% trans "Create" %}
</button>
{% else %}
<button class="btn btn-primary disabled" name="create">
{% trans "Create" %}
</button>
{% endif %}
</div>
</form>
2015-03-06 11:59:27 +00:00
</div>
<div class="tab-pane" id="netfstab">
<div class="modal-body">
<form method="post" action="" role="form" aria-label="Create storage pool with net filesystem form">{% csrf_token %}
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Type" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="stg_type" value="netfs" disabled>
<input type="hidden" name="stg_type" value="netfs">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="netfspool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Hostname" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="netfs_host" placeholder="nfs.example.com" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Remote Path" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="source" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Format" %}</label>
<div class="col-sm-6">
<select name="source_format" class="form-control" id="source_format">
<option value="auto">{% trans "auto" %}</option>
<option value="nfs">{% trans "nfs" %}</option>
<option value="glusterfs">{% trans "glusterfs" %}</option>
<option value="cifs">{% trans "cifs" %}</option>
</select>
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Local Path" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="target" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
2015-03-06 11:59:27 +00:00
<button type="submit" class="btn btn-primary" name="create">
{% trans "Create" %}
</button>
</div>
</form>
</div>
<div class="tab-pane" id="isotab">
<div class="modal-body">
<form method="post" action="" role="form" aria-label="Create iso pool form">{% csrf_token %}
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" value="iso" disabled>
<input type="hidden" name="name" value="iso">
<input type="hidden" name="stg_type" value="dir">
</div>
</div>
<div class="row">
<label class="col-sm-3 col-form-label">{% trans "Path" %}</label>
<div class="col-sm-6">
2022-11-29 12:49:17 +00:00
<input type="text" class="form-control" name="target" value="/var/lib/libvirt/iso" required pattern="[a-zA-Z0-9\/\-_]+">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-primary" name="create">
2015-03-06 11:59:27 +00:00
{% trans "Create" %}
</button>
</div>
</form>
2015-03-06 11:59:27 +00:00
</div>
</div>
</div> <!-- /.modal-body -->
2015-03-06 11:59:27 +00:00
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% endif %}