1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/virtsecrets/templates/create_secret_block.html
catborise 084f2e8b60 fix(virtsecrets): the create dialog offers only the usage types it can create
The usage list of the create-secret dialog came from the map that names
the usage types of existing secrets, so it offered none and tls too; the
form takes ceph, volume and iscsi only, and picking none or tls always
failed with "Select a valid choice". The dialog now lists the form's own
choices.
2026-10-20 22:37:51 +03:00

61 lines
No EOL
3.3 KiB
HTML

{% load i18n %}
{% load bootstrap_icons %}
{% if request.user.is_superuser %}
<a href="#AddSecret" type="button" class="btn btn-success float-end" title="{% trans "Create New Secret" %}" data-bs-toggle="modal">
<span aria-hidden="true">{% bs_icon 'plus-circle-fill' %} </span>
</a>
<!-- Modal Secret -->
<div class="modal fade" id="AddSecret" tabindex="-1" role="dialog" aria-labelledby="AddSecret" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Create New Secret" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form method="post" action="" role="form" aria-label="Create Secret form">{% csrf_token %}
<div class="modal-body">
<div class="row">
<label for="secret_ephemeral" class="col-sm-3 col-form-label">{% trans "Ephemeral" %}</label>
<div class="col-sm-6">
<select id="secret_ephemeral" name="ephemeral" class="form-control">
<option value="no">{% trans "no" %}</option>
<option value="yes">{% trans "yes" %}</option>
</select>
</div>
</div>
<div class="row">
<label for="secret_private" class="col-sm-3 col-form-label">{% trans "Private" %}</label>
<div class="col-sm-6">
<select id="secret_private" name="private" class="form-control">
<option value="no">{% trans "no" %}</option>
<option value="yes">{% trans "yes" %}</option>
</select>
</div>
</div>
<div class="row">
<label for="secret_usage_type" class="col-sm-3 col-form-label">{% trans "Usage" %}</label>
<div class="col-sm-6">
<select id="secret_usage_type" name="usage_type" class="form-control">
{% for value, label in usage_choices %}
<option value="{{ value }}">{{ label }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="row">
<label for="secret_data" class="col-sm-3 col-form-label">{% trans "Data" %}</label>
<div class="col-sm-6">
<input id="secret_data" type="text" name="data" class="form-control" value="" maxlength="100" required />
</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>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div><!-- /.modal -->
{% endif %}