Move LiveDashboard to /pleroma/live_dashboard
This commit is contained in:
parent
f16dad2879
commit
f6c410b06c
5 changed files with 15 additions and 5 deletions
1
changelog.d/phoenix-livedashboard-move.change
Normal file
1
changelog.d/phoenix-livedashboard-move.change
Normal file
|
|
@ -0,0 +1 @@
|
|||
Moved Phoenix LiveDashboard to /pleroma/live_dashboard
|
||||
|
|
@ -11,7 +11,7 @@ Pleroma comes with two types of backend dashboards viewable to instance administ
|
|||
|
||||
## Phoenix LiveDashboard
|
||||
|
||||
Instance administrators can access this dashboard at `/phoenix/live_dashboard`, giving a simple overview of software versions including Erlang and Elixir versions, instance uptime and resource consumption.
|
||||
Instance administrators can access this dashboard at `/pleroma/live_dashboard`, giving a simple overview of software versions including Erlang and Elixir versions, instance uptime and resource consumption.
|
||||
|
||||
This dashboard gives insights into the current state of the BEAM VM running Pleroma code and database statistics including basic diagnostics.
|
||||
It can be useful for troubleshooting of some issues namely regarding database performance.
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ defmodule Pleroma.Web.Fallback.RedirectController do
|
|||
)
|
||||
end
|
||||
|
||||
def live_dashboard(conn, _params) do
|
||||
conn
|
||||
|> redirect(to: "/pleroma/live_dashboard")
|
||||
end
|
||||
|
||||
def redirector(conn, _params, code \\ 200) do
|
||||
{:ok, index_content} = File.read(index_file_path(conn))
|
||||
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ defmodule Pleroma.Web.Router do
|
|||
|
||||
scope "/" do
|
||||
pipe_through([:pleroma_html, :authenticate, :require_admin])
|
||||
live_dashboard("/phoenix/live_dashboard", additional_pages: [oban: Oban.LiveDashboard])
|
||||
live_dashboard("/pleroma/live_dashboard", additional_pages: [oban: Oban.LiveDashboard])
|
||||
oban_dashboard("/pleroma/oban")
|
||||
end
|
||||
|
||||
|
|
@ -1087,15 +1087,15 @@ defmodule Pleroma.Web.Router do
|
|||
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
|
||||
match(:*, "/api/pleroma/*path", LegacyPleromaApiRerouterPlug, [])
|
||||
get("/api/*path", RedirectController, :api_not_implemented)
|
||||
get("/phoenix/live_dashboard", RedirectController, :live_dashboard)
|
||||
get("/*path", RedirectController, :redirector_with_preload)
|
||||
|
||||
options("/*path", RedirectController, :empty)
|
||||
end
|
||||
|
||||
# /pleroma/oban/* needs to get filtered out from api routes for frontend configuration
|
||||
# /pleroma/{phoenix,oban}/* need to get filtered out from api routes for frontend configuration
|
||||
# to not drop admin overrides for /pleroma/admin.
|
||||
# Also removing /phoenix since it is not an API route
|
||||
@non_api_routes ["/phoenix/live_dashboard", "/pleroma/oban"]
|
||||
@non_api_routes ["/pleroma/live_dashboard", "/pleroma/oban"]
|
||||
|
||||
def get_api_routes do
|
||||
Phoenix.Router.routes(__MODULE__)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@ defmodule Pleroma.Web.FallbackTest do
|
|||
assert redirected_to(get(conn, "/pleroma/admin")) =~ "/pleroma/admin/"
|
||||
end
|
||||
|
||||
test "GET /phoenix/live_dashboard -> /pleroma/live_dashboard", %{conn: conn} do
|
||||
assert redirected_to(get(conn, "/phoenix/live_dashboard")) =~ "/pleroma/live_dashboard"
|
||||
end
|
||||
|
||||
test "OPTIONS /*path", %{conn: conn} do
|
||||
assert conn
|
||||
|> options("/foo")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue