WardrikWeb. Router
(wardrik_web v0.1.0-rc.1)
Copy Markdown
Adds the dashboard to a Phoenix router.
import WardrikWeb.Router
scope "/" do
pipe_through :browser
wardrik_dashboard "/wardrik", resolver: {MyAppWeb.WardrikResolver, []}
end- The pipeline must fetch the session and check CSRF tokens. Phoenix's
:browserpipeline does both. - The endpoint must serve the LiveView socket with the session:
socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]].
Summary
Functions
Mounts the dashboard at path.
Functions
Mounts the dashboard at path.
Options
:resolver(tuple ofatom/0,term/0values) - Required. TheWardrikWeb.Resolverto use, as{module, opts}.:on_mount(list ofterm/0) - Youron_mounthooks, for example the one that loads the signed-in user. They run before the resolver. The default value is[].:extensions(list ofatom/0) - TheWardrikWeb.Extensionmodules to add. The default value is[].:settings(keyword/0) - The settings pages to turn on, as{module, opts}for each page.:servers,:secrets,:notify_targetsand:oauth_appstake aWardrikWeb.Settings.:connectionstakes aWardrikWeb.Connections. The default value is[].:servers:secrets:notify_targets:oauth_apps:connections
:socket_path(String.t/0) - The path of the endpoint's LiveView socket. The default value is"/live".:sign_in(String.t/0) - The path to redirect to when the resolver refuses access. The default value is"/".:live_session(atom/0) - The name of the live session. Set a different name for each dashboard if you mount more than one. The default value is:wardrik_web.