wireguard: Add template to show generated client info

Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Frederico Gomes 2026-03-21 15:03:55 +00:00 committed by James Valleroy
parent 8cbcd39bb2
commit 81e60dff0e
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -0,0 +1,46 @@
{% extends "base.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% block content %}
<h3>{{ title }}</h3>
<form class="form form-auto-add-client" method="post">
{% csrf_token %}
{{ form|bootstrap }}
{% if client_privkey %}
<div class="form-group">
<table class="table table-sm">
<tr><td>{% trans "IP Address" %}</td><td>{{ next_ip }}</td></tr>
<tr><td>{% trans "Endpoint" %}</td><td>{{ endpoint }}</td></tr>
<tr><td>{% trans "Public Key" %}</td><td>{{ client_pubkey }}</td></tr>
<tr><td>{% trans "Private Key" %}</td>
<td>
<details><summary>{% trans "Click to reveal" %}</summary>
{{ client_privkey }}
</details>
</td></tr>
</table>
<div class="alert alert-warning">
<strong>{% trans "Important:" %}</strong>
{% trans "Save the private key now. This page shows it only once!" %}
</div>
{% endif %}
<div class="form-actions">
<input type="submit" class="btn btn-primary"
value="{% trans "Add Connection" %}"/>
<a href="{% url 'wireguard:index' %}" class="btn btn-secondary">
{% trans "Cancel" %}
</a>
</div>
</form>
{% endblock %}