Conduit.Dashboard.Html
Functions
Admin action button: a POST form. A non-empty confirm is carried as a data-confirm attribute (HTML-escaped by ~H) that dashboard.js asks about before the form submits — never as inline JavaScript.
A simple flash/notice box.
Render a flash banner from query params, or "" if no recognised flash.
The router sets `?flash=<kind>&code=<slug>` after a state-changing action
redirects. `code` is mapped here to a fixed human-readable message so the
message text never round-trips through user-controlled URLs (avoiding both
injection and the need for URL decoding on input).
Recognised codes:
job_retried, job_cancelled, job_deleted,
workflow_cancelled,
cron_triggered, cron_paused, cron_resumed, cron_deleted,
dl_retried, dl_deleted, dl_all_retried, dl_all_deleted,
action_failedFold items through item_io into one IOList, preserving order.
Renders a full HTML page with the shared nav injected. content is trusted, already-built HTML.
The full page (shell, nav, content, script) as an IOList. content is raw (already-built) HTML.
Pagination links.
Render a DateTime as a relative-time span (e.g. "3m ago"), with the absolute timestamp as the title attribute. Falls back to the absolute timestamp text when the DateTime is in the future.
Like relative_time/1 but accepts an Option(DateTime) and renders "—" when the value is None. Useful for nullable last_run/next_run/completed_at columns.
Badge for job/workflow status.
Renders a <table> with a header row and data rows.
When `rows` is empty, renders a single placeholder row spanning every column
with a generic "No records." empty-state message. Use `table_with_empty/3`
to provide a custom empty-state message tailored to the page.Like table/2, but lets the caller specify the empty-state message shown when rows is empty (e.g. "No jobs in this queue yet."). Cells are trusted, already-built HTML strings (callers escape their own values).
A <table> as an IOList. rows hold cells as IOLists (build them with ~H so values are escaped). When rows is empty, renders one placeholder row spanning every column with empty_msg.