diff --git a/lib/dpul_collections_web/router.ex b/lib/dpul_collections_web/router.ex index 235a50f3..dea48070 100644 --- a/lib/dpul_collections_web/router.ex +++ b/lib/dpul_collections_web/router.ex @@ -1,5 +1,6 @@ defmodule DpulCollectionsWeb.Router do use DpulCollectionsWeb, :router + import Phoenix.LiveDashboard.Router pipeline :browser do plug :accepts, ["html"] @@ -14,6 +15,10 @@ defmodule DpulCollectionsWeb.Router do pipe_through :browser get "/", PageController, :home + live_dashboard "/dashboard", metrics: DpulCollectionsWeb.Telemetry + additional_pages: [ + broadway: BroadwayDashboard + ] end # Other scopes may use custom stacks. @@ -22,19 +27,19 @@ defmodule DpulCollectionsWeb.Router do # end # Enable LiveDashboard and Swoosh mailbox preview in development - if Application.compile_env(:dpul_collections, :dev_routes) do - # If you want to use the LiveDashboard in production, you should put - # it behind authentication and allow only admins to access it. - # If your application does not have an admins-only section yet, - # you can use Plug.BasicAuth to set up some basic authentication - # as long as you are also using SSL (which you should anyway). - import Phoenix.LiveDashboard.Router - - scope "/dev" do - pipe_through :browser - - live_dashboard "/dashboard", metrics: DpulCollectionsWeb.Telemetry - forward "/mailbox", Plug.Swoosh.MailboxPreview - end - end + # if Application.compile_env(:dpul_collections, :dev_routes) do + # # If you want to use the LiveDashboard in production, you should put + # # it behind authentication and allow only admins to access it. + # # If your application does not have an admins-only section yet, + # # you can use Plug.BasicAuth to set up some basic authentication + # # as long as you are also using SSL (which you should anyway). + # import Phoenix.LiveDashboard.Router + # + # scope "/dev" do + # pipe_through :browser + # + # live_dashboard "/dashboard", metrics: DpulCollectionsWeb.Telemetry + # forward "/mailbox", Plug.Swoosh.MailboxPreview + # end + # end end diff --git a/mix.exs b/mix.exs index f43f7e5e..8a810ef3 100644 --- a/mix.exs +++ b/mix.exs @@ -72,7 +72,8 @@ defmodule DpulCollections.MixProject do {:excoveralls, "~> 0.18", only: :test}, {:broadway, "~> 1.0"}, {:ex_doc, "~> 0.21", only: :dev, runtime: false}, - {:req, "~> 0.5.0"} + {:req, "~> 0.5.0"}, + {:broadway_dashboard, "~> 0.4.0"} ] end diff --git a/mix.lock b/mix.lock index acbc538a..df185e05 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,7 @@ %{ "bandit": {:hex, :bandit, "1.5.2", "ed0a41c43a9e529c670d0fd48371db4027e7b80d43b1942893e17deb8bed0540", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "35ddbdce7e8a2a3c6b5093f7299d70832a43ed2f4a1852885a61d334cab1b4ad"}, "broadway": {:hex, :broadway, "1.1.0", "8ed3aea01fd6f5640b3e1515b90eca51c4fc1fac15fb954cdcf75dc054ae719c", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.7 or ~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "25e315ef1afe823129485d981dcc6d9b221cea30e625fd5439e9b05f44fb60e4"}, + "broadway_dashboard": {:hex, :broadway_dashboard, "0.4.1", "a5f4cba542390ba1cb6f0d26401676312adc8330f664e7aec98b498057d757a2", [:mix], [{:broadway, "~> 1.0", [hex: :broadway, repo: "hexpm", optional: false]}, {:phoenix_live_dashboard, "~> 0.8.0", [hex: :phoenix_live_dashboard, repo: "hexpm", optional: false]}], "hexpm", "2177b4d4ab46bdc059613fa447219c974091cfc79d9ff16480a9f4aabab89020"}, "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},