2015-03-03 14:53:10 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% load i18n %}
|
2021-06-15 06:42:55 +00:00
|
|
|
{% load static %}
|
2015-03-03 14:53:10 +00:00
|
|
|
{% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %}
|
2020-10-15 14:18:45 +00:00
|
|
|
|
2015-03-10 14:46:52 +00:00
|
|
|
{% block style %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<link rel="stylesheet" href="{% static 'css/sortable-theme-bootstrap.css' %}" />
|
2015-03-10 14:46:52 +00:00
|
|
|
{% endblock %}
|
2020-10-15 14:18:45 +00:00
|
|
|
|
|
|
|
{% block page_heading %}{{ compute }} - {% trans "Secrets" %}{% endblock page_heading %}
|
|
|
|
|
2021-07-07 11:12:38 +00:00
|
|
|
{% block page_heading_extra %}
|
|
|
|
{% include 'create_secret_block.html' %}
|
|
|
|
{% endblock page_heading_extra %}
|
2020-10-15 14:18:45 +00:00
|
|
|
|
2015-03-03 14:53:10 +00:00
|
|
|
{% block content %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
2020-05-19 16:53:54 +00:00
|
|
|
<nav aria-label="breadcrumb">
|
2021-07-07 11:12:38 +00:00
|
|
|
<ol class="breadcrumb shadow-sm">
|
|
|
|
<li class="breadcrumb-item">
|
2020-05-19 16:53:54 +00:00
|
|
|
<a href="{% url 'overview' compute.id %}"><i class="fa fa-dashboard"></i> {% trans "Overview" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a href="{% url 'instances' compute.id %}"><i class="fa fa-server"></i> {% trans "Instances" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a href="{% url 'storages' compute.id %}"><i class="fa fa-hdd-o"></i> {% trans "Storages" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a href="{% url 'networks' compute.id %}"><i class="fa fa-sitemap"></i> {% trans "Networks" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a href="{% url 'interfaces' compute.id %}"><i class="fa fa-wifi"></i> {% trans "Interfaces" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a href="{% url 'nwfilters' compute.id %}"><i class="fa fa-filter"></i> {% trans "NWFilters" %}</a>
|
|
|
|
</li>
|
|
|
|
<li class="breadcrumb-item">
|
2021-07-07 11:12:38 +00:00
|
|
|
<span class="fw-bold"><i class="fa fa-key"></i> {% trans "Secrets" %}</span>
|
2020-05-19 16:53:54 +00:00
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-03 14:53:10 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="row">
|
|
|
|
{% if not secrets_all %}
|
|
|
|
<div class="col-lg-12">
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="alert alert-warning shadow-sm">
|
2020-05-19 16:53:54 +00:00
|
|
|
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning" %}:</strong> {% trans "Hypervisor doesn't have any Secrets" %}
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
|
|
|
|
<thead>
|
|
|
|
<tr class="active">
|
2020-05-19 16:53:54 +00:00
|
|
|
<th scope="col">{% trans "UUID" %}</th>
|
2020-06-04 12:45:20 +00:00
|
|
|
<th scope="col">{% trans "Usage Type" %}</th>
|
|
|
|
<th scope="col">{% trans "Data" %}</th>
|
2020-05-26 10:52:52 +00:00
|
|
|
<th scope="col" data-sortable="false" style="width:90px;">{% trans "Action" %}</th>
|
2019-07-31 08:03:48 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for secret in secrets_all %}
|
|
|
|
<tr>
|
2020-05-19 16:53:54 +00:00
|
|
|
<th scope="row">{{ secret.uuid }}</th>
|
2020-06-04 12:45:20 +00:00
|
|
|
<td>{{ secret.usageType }}</td>
|
2019-07-31 08:03:48 +00:00
|
|
|
<td>{{ secret.usage }}</td>
|
|
|
|
<td>
|
2020-05-26 13:18:38 +00:00
|
|
|
<form action="" method="post" role="form" aria-label="Delete secret form">{% csrf_token %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<input type="hidden" name="uuid" value="{{ secret.uuid }}"/>
|
2021-07-07 11:12:38 +00:00
|
|
|
<a data-bs-toggle="modal" href="#editSecret{{ secret.uuid }}" class="btn btn-sm btn-primary" title="{% trans "Edit" %}">
|
2020-05-19 16:53:54 +00:00
|
|
|
<span class="fa fa-pencil"></span>
|
2019-07-31 08:03:48 +00:00
|
|
|
</a>
|
2020-05-19 16:53:54 +00:00
|
|
|
<button type="submit" class="btn btn-sm btn-danger" name="delete" title="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
|
|
|
<span class="fa fa-trash"></span>
|
2019-07-31 08:03:48 +00:00
|
|
|
</button>
|
|
|
|
</form>
|
2015-03-06 11:59:27 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<!-- 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">
|
2020-05-19 16:53:54 +00:00
|
|
|
<h5 class="modal-title">{% trans "Set secret value" %}</h5>
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="modal-body">
|
2020-05-26 13:18:38 +00:00
|
|
|
<form method="post" role="form" aria-label="Edit secret form">{% csrf_token %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2020-05-19 16:53:54 +00:00
|
|
|
<label class="col-sm-3 col-form-label">{% trans "Value" %}</label>
|
|
|
|
<input type="hidden" name="uuid" value="{{ secret.uuid }}">
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<input type="text" name="value" class="form-control" value="{{ secret.value }}" maxlength="45" required pattern="[a-zA-Z0-9]$+">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> <!-- /.modal-content -->
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="modal-footer">
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
|
2020-05-19 16:53:54 +00:00
|
|
|
<button type="submit" class="btn btn-primary" name="set_value">{% trans "Set" %}</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div> <!-- /.tab-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2015-03-03 14:53:10 +00:00
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2015-03-10 14:46:52 +00:00
|
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
2015-04-06 07:51:50 +00:00
|
|
|
<script src="{% static "js/sortable.min.js" %}"></script>
|
2015-03-03 14:53:10 +00:00
|
|
|
{% endblock %}
|