1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/virtsecrets/templates/secrets.html
catborise faa6e4bb14 refactor(templates): Bootstrap utilities instead of the upstream rules that redid them
webvirtcloud.css still carried the upstream panel's rules for what
Bootstrap 5.3 has as utilities and components:
- the page's bottom space (body padding) is pb-5 on base.html's body,
  and the console page no longer has to undo it;
- the VM page's action tabs (.action-button, .action-block with a
  fixed 65px width) are text-center with a d-block icon; its tab panes
  (#power ... #undefine, one rule each) mt-3;
- the bordered sub-tab panes (.tab-pane-bordered, a fixed #eee border
  that dark themes could not change) border border-top-0 p-3;
- the search box and header buttons (.search, .btn-header) m-1 and
  mt-1; the SSH key select (.keyselect) a form-select;
- the boot order list (.multipleselect, fixed size, #c0c0c0 border) a
  list-group of form-check-input items; its unused .multipleselect-on
  goes;
- table cells centred by a global rule are align-middle on each table.
Two rules against Bootstrap's behaviour go: menus opened on hover on
wide screens (Bootstrap opens them on a click, and keyboard and touch
users had no hover), and "a { outline: 0 }", which hid the keyboard
focus ring.

The paragraph and page-header margins and the 900px container stay
for a separate change: they set every page's layout.
2026-10-27 19:05:48 +03:00

93 lines
5.6 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %}
{% block page_heading %}{{ compute }} - {% trans "Secrets" %}{% endblock page_heading %}
{% block page_heading_extra %}
{% include 'create_secret_block.html' %}
{% endblock page_heading_extra %}
{% block content %}
<div class="row">
<div class="col-lg-12">
{% include "computes/host_nav.html" with section="virtsecrets" %}
</div>
</div>
<div class="row">
{% if not secrets_all %}
<div class="col-lg-12">
<div class="alert alert-warning shadow-sm">
{% bs_icon 'exclamation-triangle' %} <strong>{% trans "Warning" %}:</strong> {% trans "Hypervisor doesn't have any Secrets" %}
</div>
</div>
{% else %}
<div class="col-lg-12">
<div class="table-responsive">
<table class="table table-hover align-middle" data-sortable>
<thead>
<tr class="active">
<th scope="col">{% trans "UUID" %}</th>
<th scope="col">{% trans "Usage Type" %}</th>
<th scope="col">{% trans "Data" %}</th>
<th scope="col" data-sort-method="none" style="width:90px;">{% trans "Action" %}</th>
</tr>
</thead>
<tbody>
{% for secret in secrets_all %}
<tr>
<th scope="row">{{ secret.uuid }}</th>
<td>{{ secret.usageType }}</td>
<td>{{ secret.usage|default_if_none:"" }}</td>
<td>
<form action="" method="post" role="form" aria-label="Delete secret form">{% csrf_token %}
<input type="hidden" name="uuid" value="{{ secret.uuid }}"/>
<a data-bs-toggle="modal" href="#editSecret{{ secret.uuid }}" class="btn btn-sm btn-primary" title="{% trans "Edit" %}">
<span>{% bs_icon 'pencil' %} </span>
</a>
<button type="submit" class="btn btn-sm btn-danger" name="delete" title="{% trans "Delete" %}" data-confirm="{% blocktrans with uuid=secret.uuid %}Delete secret {{ uuid }}? Its value is gone; disks and pools that need it no longer start.{% endblocktrans %}" onclick="return confirm(this.dataset.confirm)">
<span>{% bs_icon 'trash' %} </span>
</button>
</form>
<!-- Modal -->
<div class="modal fade" id="editSecret{{ secret.uuid }}" tabindex="-1" role="dialog"
aria-labelledby="editSecret" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Set secret value" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form method="post" role="form" aria-label="Edit secret form">{% csrf_token %}
<div class="modal-body">
<div class="row">
<label class="col-sm-3 col-form-label" for="secret_value_{{ secret.uuid }}">{% trans "Value" %}</label>
<input type="hidden" name="uuid" value="{{ secret.uuid }}">
<div class="col-sm-6">
<input type="password" id="secret_value_{{ secret.uuid }}" name="value" class="form-control" autocomplete="new-password" required pattern="[A-Za-z0-9+\/]*={0,2}">
</div>
</div>
</div> <!-- /.modal-content -->
<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="set_value">{% trans "Set" %}</button>
</div>
</form>
</div> <!-- /.tab-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
</div>
{% endblock %}