2020-01-08 05:53:50 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% if request.user.is_superuser %}
|
2020-01-08 08:28:46 +00:00
|
|
|
<button href="#editvol{{ id }}" type="button" class="btn btn-sm btn-default" data-toggle="modal" title="Edit Volume">
|
|
|
|
<i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
|
|
|
|
</button>
|
2020-01-08 05:53:50 +00:00
|
|
|
|
|
|
|
<!-- Modal pool -->
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="modal fade" id="editvol{{ id }}" tabindex="-1" role="dialog" aria-labelledby="editInstanceVolumeLabel{{ id }}" aria-hidden="true">
|
2020-01-08 05:53:50 +00:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
2020-01-08 08:28:46 +00:00
|
|
|
<h4 class="modal-title">{% trans "Edit Instance Volume" %}</h4>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
|
2020-01-08 05:53:50 +00:00
|
|
|
<div class="modal-body">
|
2020-01-08 08:28:46 +00:00
|
|
|
|
2020-01-08 05:53:50 +00:00
|
|
|
<ul class="nav nav-tabs">
|
2020-01-08 08:28:46 +00:00
|
|
|
<li role="presentation" class="active"><a href="#VirtualDisk{{ id }}" data-toggle="tab">{% trans 'Virtual Disk' %}</a></li>
|
|
|
|
<li role="presentation"><a href="#PerformanceVolume{{ id }}" data-toggle="tab">{% trans 'Performance' %}</a></li>
|
|
|
|
<li role="presentation"><a href="#AdvancedVolume{{ id }}" data-toggle="tab">{% trans 'Advanced' %}</a></li>
|
2020-01-08 05:53:50 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="tab-pane active" id="VirtualDisk{{ id }}">
|
2020-01-08 05:53:50 +00:00
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Volume Path' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input class="form-control" name="vol_path" value="{{ disk.path }}"/>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Readonly' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input class="form-control-static" type="checkbox" name="vol_readonly" value="True" {% if disk.readonly %}checked{% endif %}/>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Shareable' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input class="form-control-static" type="checkbox" name="vol_shareable" value="True" {% if disk.shareable %}checked{% endif %}/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane" id="AdvancedVolume{{ id }}">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-4 control-label">{% trans 'Bus' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select class="form-control" name="vol_bus">
|
|
|
|
{% for bus in bus_host %}
|
|
|
|
<option value="{{ bus }}" {% if bus == disk.bus %}selected{% endif %}>{{ bus }}</option>
|
|
|
|
{% endfor %}
|
2020-01-08 05:53:50 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Serial Number' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input class="form-control" type="text" name="vol_serial" value="{{ disk.serial }}"/>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Storage Format' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input class="form-control" type="text" name="vol_format" value="{{ disk.format }}"/>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane" id="PerformanceVolume{{ id }}">
|
2020-01-08 05:53:50 +00:00
|
|
|
<div class="form-group">
|
2020-01-08 08:28:46 +00:00
|
|
|
<label class="col-sm-4 control-label">{% trans 'Cache mode' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select class="form-control" name="vol_cache">
|
|
|
|
{% for key, val in cache_modes %}
|
|
|
|
<option value="{{ key }}" {% if key == disk.cache %}selected{% endif %}>{{ val }}</option>
|
|
|
|
{% endfor %}
|
2020-01-08 05:53:50 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-4 control-label">{% trans 'IO mode' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select class="form-control" name="vol_io_mode">
|
|
|
|
{% for key, val in io_modes %}
|
|
|
|
<option value="{{ key }}" {% if key == disk.io %}selected{% endif %}>{{ val }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-4 control-label">{% trans 'Discard mode' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select class="form-control" name="vol_discard_mode">
|
|
|
|
{% for key, val in discard_modes %}
|
|
|
|
<option value="{{ key }}" {% if key == disk.discard %}selected{% endif %}>{{ val }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-4 control-label">{% trans 'Detect zeroes' %}</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select class="form-control" name="vol_detect_zeroes">
|
|
|
|
{% for key, val in detect_zeroes_modes %}
|
|
|
|
<option value="{{ key }}" {% if key == disk.detect_zeroes %}selected{% endif %}>{{ val }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2020-01-08 05:53:50 +00:00
|
|
|
</div>
|
2020-01-08 08:28:46 +00:00
|
|
|
</div><!-- /.tabpane-content -->
|
|
|
|
</div><!-- /.tab-content -->
|
2020-01-08 05:53:50 +00:00
|
|
|
</div> <!-- /.modal-body -->
|
2020-01-08 08:28:46 +00:00
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
|
|
|
<button type="submit" class="btn btn-success" name="edit_volume">{% trans "Save" %}</button>
|
|
|
|
</div><!-- /.modal-footer -->
|
|
|
|
|
2020-01-08 05:53:50 +00:00
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
2020-01-08 08:28:46 +00:00
|
|
|
|
2020-01-08 05:53:50 +00:00
|
|
|
</div> <!-- /.modal -->
|
|
|
|
{% endif %}
|