networks: create view & url for new form

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Nektarios Katakis 2020-01-10 12:06:14 +00:00 committed by James Valleroy
parent f3d2654a13
commit cabfcbc6ef
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 24 additions and 1 deletions

View File

@ -28,7 +28,7 @@ from plinth import network
from plinth.modules import networks
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
PPPoEForm, WifiForm)
PPPoEForm, WifiForm, RouterConfigurationWizardForm)
logger = Logger(__name__)
@ -416,3 +416,22 @@ def delete(request, uuid):
'title': _('Delete Connection'),
'name': name
})
def router_configuration_help_page(request):
"""
Show the router configuration wizard page/form.
Used both for fistboot step and same networks page.
"""
if request.method == "POST":
resp = reverse_lazy('networks:index')
return redirect(resp)
else:
template_kwargs = {
'form': RouterConfigurationWizardForm,
}
return TemplateResponse(request, 'router_configuration.html',
template_kwargs)

View File

@ -19,6 +19,7 @@ URLs for the Network module
"""
from django.conf.urls import url
from stronghold.decorators import public
from . import networks as views
@ -41,4 +42,7 @@ urlpatterns = [
r'(?P<interface_name>[^/]+)/)?$', views.add_wifi, name='add_wifi'),
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/delete/$', views.delete,
name='delete'),
url(r'^sys/networks/router-setup-guide/$',
views.router_configuration_help_page,
name='router_setup'),
]