mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
openvpn: Use app.html instead of simple_app.html
- Place status section above download profile section for coding convenience. - Reuse diagnostics button and port forwarding information from app.html - Reuse status section instead of custom one. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ece2dd5e57
commit
167a4f5f8a
@ -1,4 +1,4 @@
|
|||||||
{% extends "simple_app.html" %}
|
{% extends "app.html" %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
#
|
#
|
||||||
# This file is part of FreedomBox.
|
# This file is part of FreedomBox.
|
||||||
@ -33,9 +33,54 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block configuration %}
|
{% block status %}
|
||||||
|
|
||||||
{% include "clients.html" with clients=clients enabled=is_enabled %}
|
{% if not status.is_setup and not status.setup_running %}
|
||||||
|
<h3>{% trans "Status" %}</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
OpenVPN has not yet been setup. Performing a secure setup
|
||||||
|
takes a very long time. Depending on how fast your
|
||||||
|
{{ box_name }} is, it may even take hours. If the setup
|
||||||
|
is interrupted, you may start it again.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<form class="form form-setup" method="post"
|
||||||
|
action="{% url 'openvpn:setup' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<input type="submit" class="btn btn-primary"
|
||||||
|
value="{% trans "Start setup" %}"/>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not status.is_setup and status.setup_running %}
|
||||||
|
<h3>{% trans "Status" %}</h3>
|
||||||
|
|
||||||
|
<p class="running-status-parent">
|
||||||
|
<span class='running-status loading'></span>
|
||||||
|
{% trans "OpenVPN setup is running" %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
To perform a secure setup, this process takes a very long
|
||||||
|
time. Depending on how fast your {{ box_name }} is, it may
|
||||||
|
even take hours. If the setup is interrupted, you may start
|
||||||
|
it again.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if status.is_setup %}
|
||||||
|
{{ block.super }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block configuration %}
|
||||||
|
|
||||||
{% if status.is_setup %}
|
{% if status.is_setup %}
|
||||||
|
|
||||||
@ -68,68 +113,8 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h3>{% trans "Status" %}</h3>
|
|
||||||
|
|
||||||
{% if not status.is_setup and not status.setup_running %}
|
|
||||||
<p>
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
OpenVPN has not yet been setup. Performing a secure setup
|
|
||||||
takes a very long time. Depending on how fast your
|
|
||||||
{{ box_name }} is, it may even take hours. If the setup
|
|
||||||
is interrupted, you may start it again.
|
|
||||||
{% endblocktrans %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<form class="form form-setup" method="post"
|
|
||||||
action="{% url 'openvpn:setup' %}">
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
<input type="submit" class="btn btn-primary"
|
|
||||||
value="{% trans "Start setup" %}"/>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if not status.is_setup and status.setup_running %}
|
|
||||||
<p class="running-status-parent">
|
|
||||||
<span class='running-status loading'></span>
|
|
||||||
{% trans "OpenVPN setup is running" %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
To perform a secure setup, this process takes a very long
|
|
||||||
time. Depending on how fast your {{ box_name }} is, it may
|
|
||||||
even take hours. If the setup is interrupted, you may start
|
|
||||||
it again.
|
|
||||||
{% endblocktrans %}
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if status.is_setup %}
|
{% if status.is_setup %}
|
||||||
<p class="running-status-parent">
|
{{ block.super }}
|
||||||
{% if status.is_running %}
|
|
||||||
<span class='running-status active'></span>
|
|
||||||
{% trans "OpenVPN server is running" %}
|
|
||||||
{% else %}
|
|
||||||
<span class='running-status inactive'></span>
|
|
||||||
{% trans "OpenVPN server is not running" %}
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% include "diagnostics_button.html" with module="openvpn" enabled=status.enabled %}
|
|
||||||
|
|
||||||
{% include "port-forwarding-info.html" with service_name=title %}
|
|
||||||
|
|
||||||
<h3>{% trans "Configuration" %}</h3>
|
|
||||||
|
|
||||||
<form class="form form-configuration" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
|
||||||
|
|
||||||
<input type="submit" class="btn btn-primary"
|
|
||||||
value="{% trans "Update setup" %}"/>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -59,12 +59,17 @@ def index(request):
|
|||||||
return TemplateResponse(
|
return TemplateResponse(
|
||||||
request, 'openvpn.html', {
|
request, 'openvpn.html', {
|
||||||
'title': openvpn.name,
|
'title': openvpn.name,
|
||||||
|
'name': openvpn.name,
|
||||||
'clients': openvpn.clients,
|
'clients': openvpn.clients,
|
||||||
'description': openvpn.description,
|
'description': openvpn.description,
|
||||||
'manual_page': openvpn.manual_page,
|
'manual_page': openvpn.manual_page,
|
||||||
'port_forwarding_info': openvpn.port_forwarding_info,
|
'port_forwarding_info': openvpn.port_forwarding_info,
|
||||||
'status': status,
|
'status': status,
|
||||||
'form': form
|
'form': form,
|
||||||
|
'show_status_block': True,
|
||||||
|
'is_running': status['is_running'],
|
||||||
|
'diagnostics_module_name': 'openvpn',
|
||||||
|
'is_enabled': status['enabled'],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user