mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
networks: Add page for network topology form
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz> [sunil: Use the term 'network topology' consistently] [sunil: Properly title case the <h1> title] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
3b8308b0cf
commit
e0e0a5dd60
@ -0,0 +1,21 @@
|
|||||||
|
{% comment %}
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load bootstrap %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
How is Your {{ box_name }} Connected to the Internet?
|
||||||
|
{% endblocktrans %}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
Select an option that best describes how your {{ box_name }} is connected in
|
||||||
|
your network. This information is used to guide you with further setup. It can
|
||||||
|
be changed later.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</p>
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% comment %}
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load bootstrap %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% include "network_topology_content.html" %}
|
||||||
|
|
||||||
|
<form class="form" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{{ form|bootstrap }}
|
||||||
|
|
||||||
|
<input type="submit" class="btn btn-primary" value="{% trans "Submit" %}"/>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@ -37,4 +37,6 @@ urlpatterns = [
|
|||||||
url(r'^sys/networks/firstboot/internet-connection-type/$',
|
url(r'^sys/networks/firstboot/internet-connection-type/$',
|
||||||
views.InternetConnectionTypeFirstBootView.as_view(),
|
views.InternetConnectionTypeFirstBootView.as_view(),
|
||||||
name='internet-connection-type-first-boot'),
|
name='internet-connection-type-first-boot'),
|
||||||
|
url(r'^sys/networks/network-topology/$',
|
||||||
|
views.NetworkTopologyView.as_view(), name='network-topology'),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -14,7 +14,7 @@ from plinth import kvstore, network
|
|||||||
from plinth.modules import first_boot, networks
|
from plinth.modules import first_boot, networks
|
||||||
|
|
||||||
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
|
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
|
||||||
InternetConnectionTypeForm, PPPoEForm,
|
InternetConnectionTypeForm, NetworkTopologyForm, PPPoEForm,
|
||||||
RouterConfigurationForm, WifiForm)
|
RouterConfigurationForm, WifiForm)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -406,6 +406,21 @@ def delete(request, uuid):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
class NetworkTopologyView(FormView):
|
||||||
|
"""View for local network topology form."""
|
||||||
|
template_name = 'network_topology_update.html'
|
||||||
|
form_class = NetworkTopologyForm
|
||||||
|
success_url = reverse_lazy('networks:index')
|
||||||
|
|
||||||
|
def get_initial(self):
|
||||||
|
"""Get initial form data."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def form_valid(self, form):
|
||||||
|
"""Save value to DB."""
|
||||||
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
class RouterConfigurationView(FormView):
|
class RouterConfigurationView(FormView):
|
||||||
"""View for router configuration form."""
|
"""View for router configuration form."""
|
||||||
template_name = 'router_configuration_update.html'
|
template_name = 'router_configuration_update.html'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user