March Docs

Conduit.Dashboard.Html

Functions

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

Admin action button (POST form with optional JavaScript confirm dialog).

The `confirm` message is embedded in a JavaScript string literal, so it must
be escaped for JS (not HTML) — single quotes and backslashes are the primary
injection vectors.  `Html.escape` is NOT used here because HTML entity encoding
(`'`, `&`, etc.) is not decoded inside JS string literals in browsers,
which would display garbage in the dialog box or leave injection gaps open.
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
fnpagepage(title : String, base_path : String, content : String) : String#

Renders a full HTML page with the shared nav injected.

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.

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