Expand description
The human-readable renderings, and the only place colour is woven in.
These lived in crate::admin::render beside the JSON ones until colour
arrived. The split is where the sharing actually is: every render_*_json
is read by both front ends (src/webadmin/pages/, src/webadmin/handlers/)
and must stay byte-identical for a script parsing --json, while every
renderer here has exactly one consumer, the terminal. Keeping them
together would have meant either a Palette argument threaded through
src/admin/, which is the front-end-agnostic layer, or colouring whole
lines from the print site, which is all a finished padded string allows.
Two conventions hold throughout:
- Pad first, then colour —
palette.status(&format!("{:<11}", status)). A format width counts bytes, so wrapping before padding counts the escape and collapses the column. Seesuper::style. - Colour is semantic, never decorative. Statuses, refusals and standing
warnings; not labels, not timestamps, not identifiers. A listing should
read as data with a few things standing out, and
Palette::plain()must stay the shape an operator’sawkwas written against.
Functions§
- json_
page - The envelope a paged
--jsonlisting answers with. - print_
expiring_ footer - Prints [
expiring_footer_line]. - print_
footer - Prints [
footer_line]. - print_
page - Prints one page, in whichever of the two shapes was asked for.
- render_
account_ detail_ text account show <id>, one field per line.- render_
account_ line - One line:
id profile status last_seen_from contact created_at. - render_
admin_ session_ line - One line:
id user state created_at expires_at ip. - render_
admin_ totp_ line admin user totp status, in words.- render_
admin_ user_ detail_ text admin user show <username>, one field per line.- render_
admin_ user_ line - One line:
username status totp created_at last_login. - render_
audit_ detail_ text audit show <id>, one field per line — the row carries thirteen possible fields and a single line of them would wrap on any terminal.- render_
audit_ line - One line:
id created_at event profile actor client identifiers. - render_
eab_ created_ text eab createtext output.- render_
eab_ line - One line:
kid status label created_at (RFC3339). - render_
expiring_ line - One line of
order list --expiring-in:order_id profile Nd not_after identifiers, plus areplaced-by=suffix where something has. - render_
order_ detail_ text order show, one field per line, then the authorization tree.- render_
order_ line - One line:
id status identifiers (comma-joined) created_at. - render_
profile_ line - One line:
name challenges eab directory.