A framed card for processes in steps (a build, a deploy, issuing an invoice, an import).
<.step_group id="deploy" title="Deploy logs" status={:running} duration="1m 04s">
<:step title="Preparing environment" status={:ok} result="12s" />
<:step title="Updating the stack" status={:running} result="Running…" open>
<.step_group_line n={1} at="09:41:02" tone="dim">Connecting</.step_group_line>
<.step_group_line n={2} at="09:41:04" tone="err">Rejected</.step_group_line>
</:step>
<:step title="Routing traffic" status={:waiting} result="Waiting" />
</.step_group>status is one of :ok, :running, :waiting, :failed, :skipped and :canceled.
The content of a :step is its log (step_group_line/1 lines). A step with a log is a
<button> that opens and closes the log; a step without one is a plain row. Without a
title the card is just the list of steps (no header, nothing to collapse).
Collapsing the card and opening a log happen in the browser (Phoenix.LiveView.JS), with no
round trip; collapsed and open set where the state starts.
Summary
Functions
Attributes
id(:string) - Required with atitle(the collapse button needs it). Defaults tonil.title(:string) - Defaults tonil.status(:atom) - Defaults to:waiting. Must be one of:ok,:running,:waiting,:failed,:skipped, or:canceled.duration(:string) - Defaults tonil.collapsed(:boolean) - Defaults tofalse.steps(:list) - The steps as data, instead of<:step>slots: maps with:titleand optionally:status,:result,:id. (No log: use the slots for that.). Defaults to[].current(:integer) - Withsteps: the position (from 1) of the step in progress; the ones before it are:ok, the ones after:waiting(unless a step has its own:status). Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
step- One step; its content is its log. Accepts attributes:title(:string)status(:atom)result(:string)open(:boolean)id(:string)class(:any)style(:string)
Attributes
n(:integer) (required) - The line number.at(:string) - The time of the line. Defaults tonil.tone(:string) - Defaults tonil.Must be one ofnil,"dim","err", or"ok".
Slots
inner_block(required)