Widgets
Widgets are blocks which describe how a resource should be decorated in the Maeztro UI. In the simplest form, one can write:
widget "speed" {}
This will show the value of the sensor speed
, underneath a label “SPEED”.
One can also use explicitly typed widgets:
widget sensor "id" { sensor = "sensor_name" }
: shows the value of the sensorsensor_name
(orid
ifsensor
is not specified)widget attribute "id" { attribute = "attr" }
: shows the value of the Terraform attributeattr
(orid
ifattribute
is not specified)widget value "id" { value = self.some_expression }
: shows the value of the givenvalue
HCL expression, resolved against the resource entity
These all support the following optional attributes:
label
: a title; if blank, none shown; if omitted, theid
is usedunit
: a unit to be displayed after the valuetype
: to render the value as a specific type, such asduration
; when omitted, the explicit declared type of the value is used, such as on a sensordescription
: a description to associate with the widget
The simple form, where the type is omitted, attempts to infer the type based on the attributes specified, or falls back to a sensor name if no identifying attributes are specified.