mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
service: Show port forwarding info when available
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
3cc16fc23e
commit
bf63ebaa96
@ -36,6 +36,7 @@ class EjabberdServiceView(ServiceView):
|
||||
diagnostics_module_name = 'ejabberd'
|
||||
form_class = EjabberdForm
|
||||
manual_page = ejabberd.manual_page
|
||||
port_forwarding_info = ejabberd.port_forwarding_info
|
||||
|
||||
def get_initial(self):
|
||||
initdict = super().get_initial()
|
||||
|
||||
@ -78,6 +78,7 @@ class InfinotedServiceView(ServiceView):
|
||||
diagnostics_module_name = "infinoted"
|
||||
description = description
|
||||
clients = clients
|
||||
port_forwarding_info = port_forwarding_info
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
|
||||
@ -39,6 +39,7 @@ class MinetestServiceView(ServiceView): # pylint: disable=too-many-ancestors
|
||||
form_class = MinetestForm
|
||||
clients = minetest.clients
|
||||
manual_page = minetest.manual_page
|
||||
port_forwarding_info = minetest.port_forwarding_info
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the values to fill in the form."""
|
||||
|
||||
@ -83,6 +83,7 @@ class MumbleServiceView(ServiceView):
|
||||
description = description
|
||||
clients = clients
|
||||
manual_page = manual_page
|
||||
port_forwarding_info = port_forwarding_info
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
|
||||
@ -61,6 +61,7 @@ def index(request):
|
||||
'title': openvpn.name,
|
||||
'description': openvpn.description,
|
||||
'manual_page': openvpn.manual_page,
|
||||
'port_forwarding_info': openvpn.port_forwarding_info,
|
||||
'status': status,
|
||||
'form': form
|
||||
})
|
||||
|
||||
@ -89,6 +89,7 @@ class QuasselServiceView(ServiceView):
|
||||
description = description
|
||||
clients = clients
|
||||
manual_page = manual_page
|
||||
port_forwarding_info = port_forwarding_info
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
|
||||
@ -75,6 +75,26 @@
|
||||
|
||||
{% include "internal-zone.html" %}
|
||||
|
||||
{% if port_forwarding_info %}
|
||||
<h3>{% trans "Port Forwarding" %}</h3>
|
||||
|
||||
<p>
|
||||
{% with service_name=service.name %}
|
||||
{% blocktrans trimmed %}
|
||||
If your FreedomBox is behind a router, you will need to set up port
|
||||
forwarding on your router. You should forward the following ports for
|
||||
{{ service_name }}:
|
||||
{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
{% for port in port_forwarding_info %}
|
||||
<li>{{ port.0 }} {{ port.1 }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% block configuration %}
|
||||
<h3>{% trans "Configuration" %}</h3>
|
||||
|
||||
|
||||
@ -122,6 +122,7 @@ class ServiceView(FormView):
|
||||
service_id = None
|
||||
template_name = 'service.html'
|
||||
manual_page = ""
|
||||
port_forwarding_info = None
|
||||
|
||||
@property
|
||||
def success_url(self):
|
||||
@ -177,6 +178,7 @@ class ServiceView(FormView):
|
||||
context['description'] = self.description
|
||||
context['show_status_block'] = self.show_status_block
|
||||
context['manual_page'] = self.manual_page
|
||||
context['port_forwarding_info'] = self.port_forwarding_info
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user