| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Servant.UI
Description
Embedded admin dashboard. Bootstrap 5 CSS and Vue 3, compiled in.
Security: No built-in authentication. The dashboard calls the arbiter-servant API, which has no authentication. Add auth middleware before you expose either to untrusted networks.
Quick Start
run port $ arbiterAppWithAdmin @MyRegistry config
Custom Composition
Mount the API and admin UI under a shared prefix:
type MyApp = "arbiter" :> (ArbiterAPI MyRegistry :<|> AdminUI) :<|> MyRoutes run port $ serve (Proxy @MyApp) ((arbiterServer config :<|> adminUIServer) :<|> myHandler)
The admin UI auto-discovers the API path from its own URL.
If it loads at /arbiter/ it finds the API at /arbiter/api/.
Synopsis
- type AdminUI = Raw
- adminUIServer :: Server AdminUI
- adminUIServerHoisted :: (forall x. Handler x -> m x) -> ServerT AdminUI m
- adminUIServerDev :: FilePath -> Server AdminUI
- adminUIServerDevHoisted :: (forall x. Handler x -> m x) -> FilePath -> ServerT AdminUI m
- adminApp :: Application
- adminAppDev :: FilePath -> Application
- arbiterAppWithAdmin :: forall (registry :: JobPayloadRegistry) (m :: Type -> Type). (BuildServer registry registry, HasRegistry m registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig m registry -> Application
- arbiterAppWithAdminDev :: forall (registry :: JobPayloadRegistry) (m :: Type -> Type). (BuildServer registry registry, HasRegistry m registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => FilePath -> ArbiterServerConfig m registry -> Application
Servant integration
adminUIServerHoisted :: (forall x. Handler x -> m x) -> ServerT AdminUI mSource #
Hoisted variant for integration into a route tree using a custom monad.
adminUIServerDevHoisted :: (forall x. Handler x -> m x) -> FilePath -> ServerT AdminUI mSource #
Hoisted dev-mode variant for integration into a route tree using a custom monad.
Standalone WAI app
adminApp :: ApplicationSource #
The dashboard as a standalone WAI application over the embedded files.
adminAppDev :: FilePath -> ApplicationSource #
Arguments
| :: FilePath | The static directory. |
| -> Application |
The dashboard served from disk, read per request.
Combined app helper
arbiterAppWithAdmin :: forall (registry :: JobPayloadRegistry) (m :: Type -> Type). (BuildServer registry registry, HasRegistry m registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig m registry -> ApplicationSource #
The API at /api and the admin UI at the root, in one application.
arbiterAppWithAdminDev :: forall (registry :: JobPayloadRegistry) (m :: Type -> Type). (BuildServer registry registry, HasRegistry m registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => FilePath -> ArbiterServerConfig m registry -> ApplicationSource #
Arguments
| :: forall (registry :: JobPayloadRegistry) (m :: Type -> Type). (BuildServer registry registry, HasRegistry m registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) | |
| => FilePath | The static directory. |
| -> ArbiterServerConfig m registry | |
| -> Application |
arbiterAppWithAdmin serving the UI from disk.