Documentation
¶
Overview ¶
Package web holds what the server-rendered pages share: the one stylesheet, and the template helpers that format a number for an operator.
There is no JavaScript framework here and no content delivery network. The admin panel is HTML and one stylesheet, both inside the binary, which is what lets the content security policy be "default-src 'none'" and what keeps the panel working on a machine with no route to the internet.
Index ¶
Constants ¶
const AssetPrefix = "/assets/"
AssetPrefix is where the stylesheet is mounted. It is a constant because the content security policy, the templates and the route all have to agree.
Variables ¶
This section is empty.
Functions ¶
func Assets ¶
Assets serves the embedded stylesheet. Files are immutable for the life of a build, so they are cached for a day; a new build serves a new file at the same path, which is fine for one stylesheet on an admin page.
func Bytes ¶
Bytes renders a size the way an operator reads one. Powers of 1024, because that is what PostgreSQL reports and disagreeing with the database about how big the database is would be its own support ticket.
func DateTime ¶
DateTime renders an instant in the server's own time zone, seconds included, because a diagnostics page is read next to a log file.
Types ¶
This section is empty.