diff --git a/plinth/modules/networks/templates/network_topology_content.html b/plinth/modules/networks/templates/network_topology_content.html new file mode 100644 index 000000000..5cd08dfc2 --- /dev/null +++ b/plinth/modules/networks/templates/network_topology_content.html @@ -0,0 +1,21 @@ +{% comment %} +# SPDX-License-Identifier: AGPL-3.0-or-later +{% endcomment %} + +{% load bootstrap %} +{% load i18n %} +{% load static %} + +
+ {% 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 %} +
diff --git a/plinth/modules/networks/templates/network_topology_update.html b/plinth/modules/networks/templates/network_topology_update.html new file mode 100644 index 000000000..507614722 --- /dev/null +++ b/plinth/modules/networks/templates/network_topology_update.html @@ -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" %} + + + +{% endblock %} diff --git a/plinth/modules/networks/urls.py b/plinth/modules/networks/urls.py index 861b481e7..873a5e51e 100644 --- a/plinth/modules/networks/urls.py +++ b/plinth/modules/networks/urls.py @@ -37,4 +37,6 @@ urlpatterns = [ url(r'^sys/networks/firstboot/internet-connection-type/$', views.InternetConnectionTypeFirstBootView.as_view(), name='internet-connection-type-first-boot'), + url(r'^sys/networks/network-topology/$', + views.NetworkTopologyView.as_view(), name='network-topology'), ] diff --git a/plinth/modules/networks/views.py b/plinth/modules/networks/views.py index 0616fddd7..0b7ca5fd5 100644 --- a/plinth/modules/networks/views.py +++ b/plinth/modules/networks/views.py @@ -14,7 +14,7 @@ from plinth import kvstore, network from plinth.modules import first_boot, networks from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm, - InternetConnectionTypeForm, PPPoEForm, + InternetConnectionTypeForm, NetworkTopologyForm, PPPoEForm, RouterConfigurationForm, WifiForm) 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): """View for router configuration form.""" template_name = 'router_configuration_update.html'