2017-06-03 13:03:55 +00:00
|
|
|
{% extends "hosting/base_short.html" %}
|
|
|
|
{% load staticfiles bootstrap3 i18n %}
|
2017-07-04 12:00:08 +00:00
|
|
|
{% block content %}
|
2017-06-03 13:03:55 +00:00
|
|
|
<div>
|
|
|
|
<div class="container virtual-machine-container dashboard-container ">
|
2017-08-31 14:32:20 +00:00
|
|
|
<h1 class="h1-thin"><i class="fa fa-key" aria-hidden="true"></i> {% trans "My SSH Keys" %}</h1>
|
2017-08-02 18:21:44 +00:00
|
|
|
{% if messages %}
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
{% for message in messages %}
|
|
|
|
<span>{{ message }}</span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<div class="ssh-header-container">
|
|
|
|
<p>{% trans "To generate a new key pair or to upload your existing key, click 'Add Key'" %}</p>
|
2017-08-02 19:20:27 +00:00
|
|
|
<a class="btn choice-btn" href="{% url 'hosting:choice_ssh_keys' %}" >
|
2017-08-02 19:57:29 +00:00
|
|
|
<span class="fa fa-plus"></span> {% trans "Add SSH Key" %}
|
2017-08-02 18:21:44 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2017-07-04 12:00:08 +00:00
|
|
|
|
2017-08-02 18:21:44 +00:00
|
|
|
<table class="table borderless table-hover ssh-keys-table">
|
|
|
|
<br/>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2017-08-02 19:57:29 +00:00
|
|
|
<th>{% trans "Name" %}</th>
|
|
|
|
<th>{% trans "Delete Key" %}</th>
|
|
|
|
<th>{% trans "Public Key" %}</th>
|
|
|
|
<th>{% trans "Private Key" %}</th>
|
2017-08-02 18:21:44 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for user_key in keys %}
|
|
|
|
<tr>
|
|
|
|
<td scope="row">{{user_key.name}}</td>
|
|
|
|
<td>
|
2017-09-01 18:26:01 +00:00
|
|
|
<button type="button" class="btn btn-default btn-custom-delete" data-toggle="modal" data-target="#Modal{{ user_key.id }}" style="color: #717274">
|
2017-08-02 19:57:29 +00:00
|
|
|
<span class="pc-only">{% trans "Delete" %}</span>
|
|
|
|
<span class="mob-only"><i class="fa fa-trash"></i></span>
|
2017-08-02 18:21:44 +00:00
|
|
|
</button>
|
|
|
|
<div class="modal fade" id="Modal{{user_key.id }}" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2017-09-01 18:26:01 +00:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Confirm"><span aria-hidden="true">×</span></button>
|
2017-07-04 12:00:08 +00:00
|
|
|
</div>
|
2017-08-02 18:21:44 +00:00
|
|
|
<div class="modal-body">
|
2017-09-01 18:26:01 +00:00
|
|
|
<div class="modal-icon"><i class="fa fa-trash" aria-hidden="true"></i></div>
|
|
|
|
<h4 class="modal-title" id="ModalLabel">{% trans "Delete SSH Key"%}</h4>
|
|
|
|
<div class="modal-text">
|
|
|
|
<p>{% trans "Do you want to delete this key?"%}</p>
|
|
|
|
</div>
|
2017-08-02 18:21:44 +00:00
|
|
|
<form method="post" action="{% url 'hosting:delete_ssh_key' user_key.id %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<div class="modal-footer">
|
2017-09-01 18:26:01 +00:00
|
|
|
<button type="submit" class="btn btn-danger btn-wide">{% trans "Delete"%}</button>
|
2017-07-04 14:55:43 +00:00
|
|
|
</div>
|
2017-08-02 18:21:44 +00:00
|
|
|
</form>
|
2017-07-04 14:55:43 +00:00
|
|
|
</div>
|
2017-08-02 18:21:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
2017-09-01 18:26:01 +00:00
|
|
|
<p data-toggle="modal" style="margin: 0" data-target="#Modal_public_key{{ user_key.id }}">
|
2017-08-02 19:57:29 +00:00
|
|
|
<a href="#">{% trans "Show" %}</a>
|
2017-08-02 18:21:44 +00:00
|
|
|
</p>
|
|
|
|
<div class="modal fade" id="Modal_public_key{{user_key.id }}" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2017-09-01 18:26:01 +00:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Confirm"><span aria-hidden="true">×</span></button>
|
2017-08-02 18:21:44 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2017-08-15 22:56:17 +00:00
|
|
|
<h4 class="modal-title" id="ModalLabel_Public_Key">{% trans "Public SSH Key" %}</h4>
|
2017-08-10 20:19:41 +00:00
|
|
|
<p class="key_contain" style="margin-top: 10px;">{{ user_key.public_key }}</p>
|
2017-08-02 18:21:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{% if user_key.private_key %}
|
|
|
|
<form action="{{ user_key.private_key.url }}">
|
2017-09-01 18:26:01 +00:00
|
|
|
<button style="color: #717274" type="submit" class="btn btn-default">
|
|
|
|
<span class="pc-only">{% trans "Download" %}</span>
|
|
|
|
<span class="mob-only"><i class="fa fa-download"></i></span>
|
2017-08-02 18:21:44 +00:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-06-03 13:03:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if next_url %}
|
2017-07-04 12:00:08 +00:00
|
|
|
<script type="text/javascript">
|
2017-06-03 13:03:55 +00:00
|
|
|
window.location.href = '{{next_url}}';
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
{%endblock%}
|
|
|
|
|