2016-05-20 21:11:42 +00:00
|
|
|
{% extends "hosting/base_short.html" %}
|
Created signup view. Added login after signup.Added signup url to nosystem app urls.py. Added logout view, Added logout button on nabber, Added password reset form, Added password view , Added password reset html, Added password reset email for nosystemd app. Added confirm_reset_password.html, Added confirm_ reset password view, Added confirm reset password form, Fixed reset password token generation, Started donation view, Added donation view, Added donation.html, Added donation form, Adding donation.js lib in order to capture stripe payments for nosystem app.
2016-07-22 06:24:32 +00:00
|
|
|
{% load staticfiles bootstrap3 i18n %}
|
2016-05-20 21:11:42 +00:00
|
|
|
{% block content %}
|
|
|
|
<div>
|
|
|
|
<div class="container virtual-machine-container dashboard-container ">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-9 col-md-offset-2">
|
|
|
|
<div class="col-sm-12">
|
2017-05-04 04:19:32 +00:00
|
|
|
<form method="POST" action="" >
|
|
|
|
{% csrf_token %}
|
|
|
|
<h3><i class="fa fa-key" aria-hidden="true"></i>{% trans "Access Key"%} </h3>
|
2017-05-12 05:56:35 +00:00
|
|
|
{% if messages %}
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
{% for message in messages %}
|
|
|
|
<span>{{ message }}</span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2016-05-20 21:11:42 +00:00
|
|
|
<hr/>
|
2017-05-04 04:19:32 +00:00
|
|
|
{% if not user_key %}
|
2017-05-12 05:56:35 +00:00
|
|
|
<h3>
|
2017-05-04 04:19:32 +00:00
|
|
|
{% trans "Upload your own key. "%}
|
2017-05-12 05:56:35 +00:00
|
|
|
</h3>
|
2017-05-04 04:19:32 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="comment">Paste here your public key</label>
|
|
|
|
<textarea class="form-control" rows="6" name="public_key"></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<button class="btn btn-success">{% trans "Upload Key"%} </a>
|
|
|
|
</div>
|
|
|
|
|
2017-05-12 05:56:35 +00:00
|
|
|
<h3>
|
2017-05-04 04:19:32 +00:00
|
|
|
{% trans "Or generate a new key pair."%}
|
|
|
|
|
2017-05-12 05:56:35 +00:00
|
|
|
</h3>
|
2017-05-04 04:19:32 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<button class="btn btn-success">{% trans "Generate Key Pair"%} </a>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<h5> Use your created key to access to the machine. If you lost it, contact us. </h5>
|
|
|
|
<table class="table borderless table-hover">
|
|
|
|
<br/>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{% trans "Name"%}</th>
|
|
|
|
<th>{% trans "Created at"%} </th>
|
|
|
|
<th>{% trans "Status"%} </th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td scope="row">{{user_key.name}}</td>
|
|
|
|
<td>{{user_key.created_at}}</td>
|
|
|
|
<td>
|
|
|
|
<span class="h3 label label-success"><strong>Active</strong></span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
|
2016-05-24 06:19:49 +00:00
|
|
|
{% if private_key %}
|
|
|
|
<div class="alert alert-warning">
|
2016-07-19 02:24:44 +00:00
|
|
|
|
2017-05-12 05:56:35 +00:00
|
|
|
<strong>{% trans "Warning!"%}</strong>{% trans "You can download your SSH private key once. Don't lost your key"%}
|
2016-05-24 06:19:49 +00:00
|
|
|
</div>
|
2016-05-20 21:11:42 +00:00
|
|
|
<div class="form-group">
|
2017-05-04 04:19:32 +00:00
|
|
|
<textarea class="form-control" rows="6" id="ssh_key" type="hidden" style="display:none">{{private_key}}</textarea>
|
2016-05-24 06:19:49 +00:00
|
|
|
|
2016-05-20 21:11:42 +00:00
|
|
|
</div>
|
2017-05-04 04:19:32 +00:00
|
|
|
<!-- <div class="form-group pull-right">
|
2016-05-24 06:19:49 +00:00
|
|
|
<button type="button" id="copy_to_clipboard" data-clipboard-target="#ssh_key" class="btn btn-warning"
|
2016-07-19 02:24:44 +00:00
|
|
|
data-toggle="tooltip" data-placement="bottom" title="Copied" data-trigger="click">{% trans "Copy to Clipboard"%}</button>
|
|
|
|
<button type="button" id="download_ssh_key" class="btn btn-warning">{% trans "Download"%}</button>
|
2017-05-04 04:19:32 +00:00
|
|
|
</div> -->
|
2016-05-24 06:19:49 +00:00
|
|
|
{% else %}
|
2017-05-04 04:19:32 +00:00
|
|
|
<!-- <div class="alert alert-warning">
|
2016-07-19 02:24:44 +00:00
|
|
|
<strong>{% trans "Warning!"%}</strong>{% trans "Your SSH private key was already generated and downloaded, if you lost it, contact us. "%}
|
2016-05-24 06:19:49 +00:00
|
|
|
</div>
|
2017-05-04 04:19:32 +00:00
|
|
|
--> {% endif %}
|
|
|
|
<!-- <a class="btn btn-success" href="{% url 'hosting:virtual_machines' %}">{% trans "Generate my key"%} </a> -->
|
2016-05-24 06:19:49 +00:00
|
|
|
<div class="clearfix"></div>
|
2016-05-20 21:11:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-24 06:19:49 +00:00
|
|
|
|
|
|
|
{% if private_key %}
|
|
|
|
<!-- Force to download ssh key on page load -->
|
2016-05-20 21:11:42 +00:00
|
|
|
<script type="text/javascript">
|
2016-05-24 06:19:49 +00:00
|
|
|
|
2017-05-04 04:19:32 +00:00
|
|
|
var key = window.document.getElementById('ssh_key');
|
|
|
|
|
2016-05-24 06:19:49 +00:00
|
|
|
var a = window.document.createElement('a');
|
|
|
|
|
2017-05-04 04:19:32 +00:00
|
|
|
a.href = window.URL.createObjectURL(new Blob([key.value], {type: 'text'}));
|
|
|
|
a.download = '{{key_name}}.pem';
|
2016-05-24 06:19:49 +00:00
|
|
|
|
|
|
|
// Append anchor to body.
|
|
|
|
document.body.appendChild(a);
|
|
|
|
a.click();
|
|
|
|
|
|
|
|
// Remove anchor from body
|
|
|
|
document.body.removeChild(a);
|
|
|
|
|
2017-05-11 05:11:33 +00:00
|
|
|
|
2016-05-20 21:11:42 +00:00
|
|
|
</script>
|
2016-05-24 06:19:49 +00:00
|
|
|
{%endif%}
|
|
|
|
|
|
|
|
|
2016-05-20 21:11:42 +00:00
|
|
|
{%endblock%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|