mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
networks: Update main networks page Internet connectivity section
Closes: #1555 Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz> [sunil: Use the term 'network topology' consistently] [sunil: s/Router/router in template] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
2a00b186ea
commit
06664e1489
43
plinth/modules/networks/templates/network_topology_main.html
Normal file
43
plinth/modules/networks/templates/network_topology_main.html
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{% comment %}
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load bootstrap %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
{{ box_name }} Internet Connectivity
|
||||||
|
{% endblocktrans %}
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
The following best describes how your {{ box_name }} is connected in your
|
||||||
|
network. This information is used only to suggest necessary configuration
|
||||||
|
actions.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% if network_topology == "to_router" %}
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
Your {{ box_name }} gets its Internet connection from your router via Wi-Fi
|
||||||
|
or Ethernet cable. This is a typical home setup.
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% elif network_topology == "as_router" %}
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
Your {{ box_name }} is directly connected to the Internet and all your
|
||||||
|
devices connect to {{ box_name }} for their Internet connectivity.
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% else %}
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
Your Internet connection is directly attached to your {{ box_name }} and there
|
||||||
|
are no other devices on the network.
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endif %}
|
||||||
|
<a href="{% url 'networks:network-topology' %}" class="btn btn-default"
|
||||||
|
role="button">
|
||||||
|
{% trans 'Update...' %}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
{% block configuration %}
|
{% block configuration %}
|
||||||
{% include "connections_list.html" %}
|
{% include "connections_list.html" %}
|
||||||
|
|
||||||
{% include "router_configuration_main.html" %}
|
{% include "network_topology_main.html" %}
|
||||||
|
|
||||||
{% include "internet_connectivity_main.html" %}
|
{% include "internet_connectivity_main.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
{% comment %}
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
{% endcomment %}
|
|
||||||
|
|
||||||
{% load bootstrap %}
|
|
||||||
{% load i18n %}
|
|
||||||
|
|
||||||
<h3>
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
{{ box_name }} Internet Connectivity
|
|
||||||
{% endblocktrans %}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
The following best describes how your {{ box_name }} is connected in your
|
|
||||||
network. This information is used only to suggest necessary configuration
|
|
||||||
actions.
|
|
||||||
{% endblocktrans %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
Your {{ box_name }} gets its Internet from your Router via Wi-Fi or
|
|
||||||
Ethernet cable. This is a typical home setup.
|
|
||||||
{% endblocktrans %}
|
|
||||||
<a href="{% url 'networks:router-configuration' %}" class="btn btn-default"
|
|
||||||
role="button">
|
|
||||||
{% trans 'Update...' %}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
@ -24,6 +24,8 @@ def index(request):
|
|||||||
"""Show connection list."""
|
"""Show connection list."""
|
||||||
connections = network.get_connection_list()
|
connections = network.get_connection_list()
|
||||||
|
|
||||||
|
network_topology = kvstore.get_default(networks.NETWORK_TOPOLOGY_TYPE_KEY,
|
||||||
|
'to_router')
|
||||||
internet_connection_type = kvstore.get_default(
|
internet_connection_type = kvstore.get_default(
|
||||||
networks.INTERNET_CONNECTION_TYPE_KEY, 'unknown')
|
networks.INTERNET_CONNECTION_TYPE_KEY, 'unknown')
|
||||||
return TemplateResponse(
|
return TemplateResponse(
|
||||||
@ -34,7 +36,8 @@ def index(request):
|
|||||||
'has_diagnostics': True,
|
'has_diagnostics': True,
|
||||||
'is_enabled': True,
|
'is_enabled': True,
|
||||||
'connections': connections,
|
'connections': connections,
|
||||||
'internet_connectivity_type': internet_connection_type
|
'network_topology': network_topology,
|
||||||
|
'internet_connectivity_type': internet_connection_type,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -426,6 +429,9 @@ class NetworkTopologyView(FormView):
|
|||||||
logger.info('Updating network topology type with value %s' %
|
logger.info('Updating network topology type with value %s' %
|
||||||
network_topology)
|
network_topology)
|
||||||
kvstore.set(networks.NETWORK_TOPOLOGY_TYPE_KEY, network_topology)
|
kvstore.set(networks.NETWORK_TOPOLOGY_TYPE_KEY, network_topology)
|
||||||
|
if network_topology == 'to_router':
|
||||||
|
self.success_url = reverse_lazy('networks:router-configuration')
|
||||||
|
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user