diff --git a/lib/vintage_net_wizard/web/router.ex b/lib/vintage_net_wizard/web/router.ex index e8687832..306b9589 100644 --- a/lib/vintage_net_wizard/web/router.ex +++ b/lib/vintage_net_wizard/web/router.ex @@ -6,6 +6,7 @@ defmodule VintageNetWizard.Web.Router do alias VintageNetWizard.{ Backend, + Web.Endpoint, WiFiConfiguration } @@ -112,6 +113,20 @@ defmodule VintageNetWizard.Web.Router do render_page(conn, "apply.html", ssid: VintageNetWizard.APMode.ssid()) end + get "/complete" do + :ok = Backend.complete() + + _ = + Task.Supervisor.start_child(VintageNetWizard.TaskSupervisor, fn -> + # We don't want to stop the server before we + # send the response back. + :timer.sleep(3000) + Endpoint.stop_server() + end) + + render_page(conn, "complete.html") + end + forward("/api/v1", to: VintageNetWizard.Web.Api) match _ do diff --git a/priv/templates/index.html.eex b/priv/templates/index.html.eex index 90e8240a..c123b7b6 100644 --- a/priv/templates/index.html.eex +++ b/priv/templates/index.html.eex @@ -62,7 +62,7 @@ Add a New Network <%= if length(configs) > 0 do %> Apply configuration - Complete Without Verification + Complete Without Verification <% end %>