March Docs

Conduit.Dashboard.Html

Functions

fnaction_btnaction_btn(action_url : String, label : String, confirm : String) : String#

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.

fnflashflash(kind : String, message : String) : String#

A simple flash/notice box.

fnflash_from_queryflash_from_query(kind : String, code : String) : String#

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_failed
fnlist_iolist_io(items, item_io) : IOList#

Fold items through item_io into one IOList, preserving order.

fnnav_ionav_io(base_path : String, current : String) : IOList#

The top navigation bar.

fnpagepage(title : String, base_path : String, content : String) : String#

Renders a full HTML page with the shared nav injected. content is trusted, already-built HTML.

fnpage_iopage_io(title : String, base_path : String, current : String, content : IOList) : IOList#

The full page (shell, nav, content, script) as an IOList. content is raw (already-built) HTML.

fnpage_with_navpage_with_nav(title : String, base_path : String, current : String, content : String) : String#

Renders a full HTML page with the shared nav injected, with active tab. content is trusted, already-built HTML.

fnpaginationpagination(base_url : String, current_page : Int, total_pages : Int) : String#

Pagination links.

fnrelative_timerelative_time(dt : DateTime) : String#

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.

fnrelative_time_optrelative_time_opt(odt : Option(DateTime)) : String#

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.

fnstatus_badgestatus_badge(status : String) : String#

Badge for job/workflow status.

fntabletable(headers : List(String), rows : List(List(String))) : String#

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.
fntable_with_emptytable_with_empty(headers : List(String), rows : List(List(String)), empty_msg : String) : String#

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).

fntable_with_empty_iotable_with_empty_io(headers : List(String), rows : List(List(IOList)), empty_msg : String) : IOList#

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.