mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-05-26 23:19:40 +00:00
account view now displays user public keys
This commit is contained in:
@@ -13,6 +13,29 @@
|
|||||||
|
|
||||||
{% include 'errors_block.html' %}
|
{% include 'errors_block.html' %}
|
||||||
|
|
||||||
|
{% if request.user.is_superuser and publickeys %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{% trans "Key name" %}</th>
|
||||||
|
<th>{% trans "Public key" %}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for publickey in publickeys %}
|
||||||
|
<td>{{ publickey.keyname }}</td>
|
||||||
|
<td title="{{ publickey.keypublic }}">{{ publickey.keypublic|truncatechars:64 }}</td>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
{% if not user_insts %}
|
{% if not user_insts %}
|
||||||
@@ -112,4 +135,4 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ def account(request, user_id):
|
|||||||
user = User.objects.get(id=user_id)
|
user = User.objects.get(id=user_id)
|
||||||
user_insts = UserInstance.objects.filter(user_id=user_id)
|
user_insts = UserInstance.objects.filter(user_id=user_id)
|
||||||
instances = Instance.objects.all().order_by('name')
|
instances = Instance.objects.all().order_by('name')
|
||||||
|
publickeys = UserSSHKey.objects.filter(user_id=user_id)
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if 'delete' in request.POST:
|
if 'delete' in request.POST:
|
||||||
|
|||||||
Reference in New Issue
Block a user