2018-10-19 13:11:22 +00:00
|
|
|
{% load i18n %}
|
2018-10-19 13:14:33 +00:00
|
|
|
{% if request.user.is_superuser %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<a href="#addvol" type="button" class="btn btn-success pull-right" data-toggle="modal" title="Add Volume">
|
|
|
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
|
|
|
</a>
|
2018-10-19 13:11:22 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<!-- Modal pool -->
|
|
|
|
<div class="modal fade" id="addvol" tabindex="-1" role="dialog" aria-labelledby="addInstanceVolumeLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h4 class="modal-title">{% trans "Add Instance Volume" %}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="row">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li role="presentation" class="active"><a href="#NewDisk" data-toggle="tab">{% trans 'New Disk' %}</a></li>
|
|
|
|
<li role="presentation"><a href="#ExistingDisk" data-toggle="tab">{% trans 'Existing Disk' %}</a></li>
|
|
|
|
</ul>
|
2018-10-24 09:04:05 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane active" id="NewDisk">
|
|
|
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
2018-10-24 09:04:05 +00:00
|
|
|
|
|
|
|
<p style="font-weight:bold;">{% trans "Volume parameters" %}</p>
|
|
|
|
<div class="form-group">
|
2018-11-22 12:48:02 +00:00
|
|
|
<label class="col-sm-3 control-label">{% trans "Storage" %}</label>
|
2018-10-24 09:04:05 +00:00
|
|
|
<div class="col-sm-4">
|
2019-07-31 08:03:48 +00:00
|
|
|
<select name="storage" class="form-control image-format">
|
2019-09-10 13:05:23 +00:00
|
|
|
{% for storage in storages_host %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<option value="{{ storage }}">{{ storage }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" name="name" placeholder="{% trans "Name" %}" required pattern="[a-zA-Z0-9\.\-_]+">
|
2018-10-24 09:04:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2019-07-31 08:03:48 +00:00
|
|
|
<label class="col-sm-3 control-label">{% trans "Format" %}</label>
|
2018-10-24 09:04:05 +00:00
|
|
|
<div class="col-sm-4">
|
2019-07-31 08:03:48 +00:00
|
|
|
<select name="format" class="form-control image-format">
|
|
|
|
{% for format in formats %}
|
|
|
|
<option value="{{ format }}" {% if format == default_format %}selected{% endif %}>{% trans format %}</option>
|
|
|
|
{% endfor %}
|
2018-10-24 09:04:05 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Size" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" name="size" value="10" maxlength="5" required pattern="[0-9]+">
|
|
|
|
</div>
|
|
|
|
<label class="col-sm-1 control-label">{% trans "GB" %}</label>
|
|
|
|
</div>
|
2018-10-24 09:04:05 +00:00
|
|
|
<div class="form-group">
|
2018-11-22 12:48:02 +00:00
|
|
|
<label class="col-sm-3 control-label">{% trans "Bus" %}</label>
|
2018-10-24 09:04:05 +00:00
|
|
|
<div class="col-sm-4">
|
|
|
|
<select name="bus" class="form-control image-format">
|
2019-12-09 10:41:31 +00:00
|
|
|
{% for bus in bus_host %}
|
2018-10-24 09:04:05 +00:00
|
|
|
<option value="{{ bus }}" {% if bus == default_bus %}selected{% endif %}>{% trans bus %}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-11-22 12:48:02 +00:00
|
|
|
<label class="col-sm-3 control-label">{% trans "Cache" %}</label>
|
2018-10-24 09:04:05 +00:00
|
|
|
<div class="col-sm-4">
|
|
|
|
<select name="cache" class="form-control image-format">
|
|
|
|
{% for mode, name in cache_modes %}
|
|
|
|
<option value="{{ mode }}" {% if mode == default_cache %}selected{% endif %}>{% trans name %}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="form-group meta-prealloc">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="checkbox" name="meta_prealloc" value="true">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-01-08 08:25:55 +00:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
|
|
|
<button type="submit" class="btn btn-success" name="add_new_vol">{% trans "Add Volume" %}</button>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2018-10-24 09:04:05 +00:00
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="tab-pane" id="ExistingDisk">
|
|
|
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
|
|
|
<div class="modal-body">
|
|
|
|
<p style="font-weight:bold;">{% trans "Volume parameters" %}</p>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Storage" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<div class="dropdown">
|
|
|
|
<button id="select_storage" class="btn btn-default dropdown-toggle form-control" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %}
|
|
|
|
<span class="caret"></span></button>
|
|
|
|
<ul class="dropdown-menu">
|
2019-10-28 07:45:27 +00:00
|
|
|
{% for storage in storages_host %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
<input id="selected_storage" name="selected_storage" hidden/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label" >{% trans "Volume" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select id="vols" name="vols" class="form-control" disabled>
|
|
|
|
<option value="" selected>{% trans 'None' %}</option>
|
|
|
|
<!-- populate with javascript -->
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Bus" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select name="bus" class="form-control image-format">
|
2019-10-28 07:45:27 +00:00
|
|
|
{% for bus in bus_host %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<option value="{{ bus }}" {% if bus == default_bus %}selected{% endif %}>{% trans bus %}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">{% trans "Cache" %}</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select name="cache" class="form-control image-format">
|
|
|
|
{% for mode, name in cache_modes %}
|
|
|
|
<option value="{{ mode }}" {% if mode == default_cache %}selected{% endif %}>{% trans name %}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-01-08 08:25:55 +00:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
|
|
|
<button type="submit" class="btn btn-success" name="add_existing_vol">{% trans "Add Volume" %}</button>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2018-10-24 09:04:05 +00:00
|
|
|
</div>
|
2018-10-19 13:11:22 +00:00
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div> <!-- row -->
|
|
|
|
</div> <!-- /.modal-body -->
|
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|
2018-10-19 13:11:22 +00:00
|
|
|
{% endif %}
|