ChoreRunnerUI.ChoreLive (chore_runner v0.2.1)
A LiveView used in conjunction with ChoreRunner's regular functionality. Features logging and data value display of all running chores locally and on all connected nodes. Allows the running of chores (with autogenerated forms based on chore inputs), as well as stopping running 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 Chore LiveView for the Chore UI to function.
Make the Chore LiveView 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
end
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!