[Enhancement] Adds in-app diagnostics page (#243)

* Added improved sidebar menuing

* Added new view for getting diagnostic data

* Changed default log level to debug

* Disabled false-positive static analysis
This commit is contained in:
Kieran
2024-05-15 12:27:57 -07:00
committed by GitHub
parent 1f1cd1cb63
commit bdcb49185a
10 changed files with 193 additions and 19 deletions
@@ -23,4 +23,20 @@ defmodule PinchflatWeb.Settings.SettingController do
render(conn, "show.html", changeset: changeset)
end
end
def app_info(conn, _params) do
render(conn, "app_info.html")
end
def download_logs(conn, _params) do
log_path = Application.get_env(:pinchflat, :log_path)
if log_path && File.exists?(log_path) do
send_download(conn, {:file, log_path}, filename: "pinchflat-logs-#{Date.utc_today()}.txt")
else
conn
|> put_flash(:error, "Log file couldn't be found")
|> redirect(to: ~p"/app_info")
end
end
end