mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
56 lines
2.5 KiB
HTML
56 lines
2.5 KiB
HTML
{% extends 'users/base.html' %}
|
|
{% load static %}
|
|
{% load form_helpers %}
|
|
|
|
{% block title %}User Key{% endblock %}
|
|
|
|
{% block usercontent %}
|
|
{% if object.is_active %}
|
|
<div class="alert alert-danger" role="alert">
|
|
<strong>Warning:</strong> Changing your public key will require your user key to be re-activated by another
|
|
user. You will be unable to retrieve any secrets until your key has been reactivated.
|
|
</div>
|
|
{% endif %}
|
|
<form action="." method="post" class="form">
|
|
{% csrf_token %}
|
|
<div class="field-group">
|
|
{% render_field form.public_key %}
|
|
</div>
|
|
<div class="row my-3">
|
|
<div class="col-4 text-start">
|
|
<button type="button" class="btn btn-info" id="generate_keypair" data-bs-toggle="modal" data-bs-target="#new_keypair_modal">Generate a New Key Pair</button>
|
|
</div>
|
|
<div class="col-8 text-end">
|
|
<a href="{% url 'user:userkey' %}" class="btn btn-outline-danger">Cancel</a>
|
|
<button type="submit" name="_update" class="btn btn-primary">Save</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="modal fade" id="new_keypair_modal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title" id="new_keypair_modal_title">
|
|
New RSA Key Pair
|
|
</h4>
|
|
<button type="button" class="btn btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="field-group">
|
|
<h5>New Public Key</h5>
|
|
<textarea class="form-control" rows="10" id="new_pubkey" style="height: 250px;font-family:var(--bs-font-monospace);"></textarea>
|
|
</div>
|
|
|
|
<div class="field-group">
|
|
<h5>New Private Key</h5>
|
|
<textarea class="form-control" rows="10" id="new_privkey" style="height: 250px;font-family:var(--bs-font-monospace);"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer text-center">
|
|
<button type="button" class="btn btn-danger" id="use_new_pubkey" data-bs-dismiss="modal">I Saved My New Private Key</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|