arbiter-servant-ui-0.1.0.0: Embedded admin dashboard for arbiter job queue
Safe HaskellNone
LanguageGHC2024

Arbiter.Servant.UI

Description

Embedded admin dashboard for Arbiter.

Provides a Bootstrap 5 + Alpine.js admin UI served from compiled-in static files.

Security: This module provides no built-in authentication. The admin UI exposes full queue management (view, delete, retry jobs). Add your own auth middleware before exposing this 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/v1/.

Synopsis

Servant integration

type AdminUI = Raw Source #

Servant API type for the admin UI (catch-all behind API routes)

adminUIServer :: Server AdminUI Source #

Servant server for AdminUI

adminUIServerDev :: FilePath -> Server AdminUI Source #

Dev-mode Servant server for AdminUI — serves from disk.

Standalone WAI app

adminApplication :: Application Source #

Standalone WAI Application serving embedded static files.

Serves index.html for / and other files by relative path.

devAdminApplication :: FilePath -> Application Source #

Dev-mode WAI Application serving static files from disk.

Reads files on every request — no recompile needed for HTML/JS/CSS changes.

Combined app helper

arbiterAppWithAdmin :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig registry -> Application Source #

Combine arbiterApp with admin UI

Serves the API at /api/v1/... and admin UI at /

arbiterAppWithAdminDev :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => FilePath -> ArbiterServerConfig registry -> Application Source #

Like arbiterAppWithAdmin but serves static files from disk for development.