Cleanup
This commit is contained in:
parent
4119328864
commit
5dfd11f31e
10 changed files with 22 additions and 93 deletions
|
@ -31,7 +31,6 @@ defmodule Eisrom.Morse.Server do
|
|||
if worker_alive?(pid) do
|
||||
EisromUi.Morse.Worker.kill(pid)
|
||||
Phoenix.PubSub.broadcast(EisromUi.PubSub, "morse_progress", 0)
|
||||
# apply(pubsub(), :broadcast, [EisromUi.PubSub, "morse_progress", 0])
|
||||
{:reply, :ok, {nil, 0}}
|
||||
else
|
||||
pid = spawn(&EisromUi.Morse.Worker.signal/0)
|
||||
|
@ -50,14 +49,9 @@ defmodule Eisrom.Morse.Server do
|
|||
@impl true
|
||||
def handle_cast({:progress, new_progress}, {pid, _progress}) do
|
||||
Phoenix.PubSub.broadcast(EisromUi.PubSub, "morse_progress", new_progress)
|
||||
# apply(pubsub(), :broadcast, [EisromUi.PubSub, "morse_progress", new_progress])
|
||||
{:noreply, {pid, new_progress}}
|
||||
end
|
||||
|
||||
defp pubsub do
|
||||
Application.fetch_env!(:eisrom_ui, :pubsub)
|
||||
end
|
||||
|
||||
defp worker_alive?(pid) do
|
||||
pid != nil and Process.alive?(pid)
|
||||
end
|
||||
|
|
|
@ -30,10 +30,6 @@ defmodule EisromUiWeb.Endpoint do
|
|||
plug Phoenix.CodeReloader
|
||||
end
|
||||
|
||||
plug Phoenix.LiveDashboard.RequestLogger,
|
||||
param_key: "request_logger",
|
||||
cookie_key: "request_logger"
|
||||
|
||||
plug Plug.RequestId
|
||||
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
|
||||
|
||||
|
|
|
@ -27,26 +27,4 @@ defmodule EisromUiWeb.Router do
|
|||
get "/OB13", PageController, :morse
|
||||
get "/seinlamp", PageController, :morse
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
# scope "/api", EisromUiWeb do
|
||||
# pipe_through :api
|
||||
# end
|
||||
|
||||
# Enables LiveDashboard only for development
|
||||
#
|
||||
# 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).
|
||||
if Mix.env() in [:dev, :test] do
|
||||
import Phoenix.LiveDashboard.Router
|
||||
|
||||
scope "/" do
|
||||
pipe_through :browser
|
||||
|
||||
live_dashboard "/dashboard", metrics: EisromUiWeb.Telemetry
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
defmodule EisromUiWeb.LayoutView do
|
||||
use EisromUiWeb, :view
|
||||
|
||||
# Phoenix LiveDashboard is available only in development by default,
|
||||
# so we instruct Elixir to not warn if the dashboard route is missing.
|
||||
@compile {:no_warn_undefined, {Routes, :live_dashboard_path, 2}}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue