AuroraMeter. LiveDashboard. View
(Aurora Meter v1.0.0)
View Source
Internal. Not part of the supported API (see API inventory).
It may change in any release, including a patch. A host mounts
AuroraMeter.LiveDashboard.Page; this is what that page renders with.
The rendering half of AuroraMeter.LiveDashboard.Page, as plain HEEx.
It is separate from the page for one reason: Phoenix.LiveDashboard is an
optional dependency and the behaviour the acceptance criteria are about (a
refusal renders no data, an unreadable section renders "unavailable" and
never a zero, a stale gauge says how stale) must be testable in a build that
does not have it. This module needs only Phoenix.Component, which the
package already declares optionally, so Phoenix.LiveViewTest.render_component/2
can drive every panel directly.
Nothing here reads anything. It renders what
AuroraMeter.LiveDashboard.Sections.read/1 returned, and the readings for
every section are passed in together, so a page cannot render one section
from a fresh read and another from a stale one.
Summary
Functions
The whole page.
The panel shown when the configured check did not return true.
One section: its figures, or the word "unavailable" with the error class and the runbook link.
Functions
@spec page(map()) :: Phoenix.LiveView.Rendered.t()
The whole page.
readings is [{section, reading}] in Sections.sections/0 order,
allowed? is the result of the host's authorization check and check is
the configured check, named in the refusal panel.
Attributes
allowed?(:boolean) (required)check(:any) (required)readings(:list) - Defaults to[].
@spec refusal(map()) :: Phoenix.LiveView.Rendered.t()
The panel shown when the configured check did not return true.
It names the check and renders no row, count, tenant key, provider reference or payment value, because there is nothing it could render that the check has not refused.
Attributes
check(:any) (required)
@spec section(map()) :: Phoenix.LiveView.Rendered.t()
One section: its figures, or the word "unavailable" with the error class and the runbook link.
An unavailable section renders no numeric cell at all. It does not
render 0 and it does not render an empty table: an operator reads both as
"nothing is wrong", and the case this exists for is the one where something
is wrong and nobody can see it.
Attributes
name(:atom) (required)reading(:any) (required)