ChoreRunnerUI.DownloadsLive (chore_runner v0.5.0)
A LiveView used in conjunction with ChoreRunner's regular functionality. Allows viewing and downloading of files generated by Chores.
Usage
Make sure that Chore.Supervisor
is added in your application
children = [
{Phoenix.PubSub, name: MyApp.PubSub},
{ChoreRunner, pubsub: MyApp.PubSub}
]
A pubsub MUST BE RUNNING and configured for both the Chore supervisor and the ChoreRunner LiveViews for the Downloads UI to function.
Make the Downloads LiveView and downloadable files accessible in your Phoenix web app by modifying the router.
Router
@chore_session %{
"otp_app" => :my_app,
"chore_root" => MyApp.Chores,
"pubsub" => MyApp.PubSub
}
scope "/" do
pipe_through :browser
live_session :chores, session: @chore_session do
live "/", ChoreRunnerUI.ChoreLive, :index
live "/", ChoreRunnerUI.DownloadsLive, :index
end
forward "/chore_downloads", ChoreRunnerUI.DownloadsPlug
end
The "chore_root"
key in the session should be the module root that all of your chore modules use.
For example: if your root is MyApp.Chores
your chore modules should be named like MyApp.Chores.MyChore
Now you can visit the speficied url and start running chores!
Link to this section Summary
Functions
Callback implementation for Phoenix.LiveView.render/1
.
Link to this section Functions
render(assigns)
Callback implementation for Phoenix.LiveView.render/1
.