2022-02-10 15:28:26 +00:00
|
|
|
{{#let
|
|
|
|
(group-by "Status" (or @items (array)))
|
|
|
|
as |grouped|}}
|
|
|
|
{{! Check the status of each Status of checks in order }}
|
|
|
|
{{! First one to have more than one check wins }}
|
|
|
|
{{! Otherwise we are empty }}
|
|
|
|
{{#let
|
|
|
|
(or
|
|
|
|
(if (gt grouped.critical.length 0) grouped.critical)
|
|
|
|
(if (gt grouped.warning.length 0) grouped.warning)
|
|
|
|
(if (gt grouped.passing.length 0) grouped.passing)
|
|
|
|
(array)
|
|
|
|
)
|
|
|
|
as |checks|}}
|
|
|
|
{{#let
|
|
|
|
checks.firstObject.Status
|
|
|
|
as |status|}}
|
|
|
|
<dl
|
|
|
|
class={{class-map
|
|
|
|
'consul-instance-checks'
|
|
|
|
(array 'empty' (eq checks.length 0))
|
|
|
|
(array status (not-eq checks.length 0))
|
|
|
|
}}
|
|
|
|
...attributes
|
|
|
|
>
|
2020-10-14 08:03:39 +00:00
|
|
|
<dt>
|
|
|
|
<Tooltip>
|
|
|
|
{{capitalize @type}} Checks
|
|
|
|
</Tooltip>
|
|
|
|
</dt>
|
2022-02-10 15:28:26 +00:00
|
|
|
{{#let
|
|
|
|
(or
|
|
|
|
(if (eq status 'critical') 'failing')
|
|
|
|
(if (eq status 'warning') 'with a warning')
|
|
|
|
status
|
|
|
|
)
|
|
|
|
as |humanized|}}
|
|
|
|
<dd>
|
|
|
|
{{or
|
|
|
|
(if (eq checks.length 0) (concat 'No ' @type ' checks'))
|
|
|
|
(if (eq checks.length @items.length) (concat 'All ' @type ' checks ' humanized))
|
|
|
|
(concat checks.length '/' @items.length ' ' @type ' checks ' humanized)
|
|
|
|
}}
|
|
|
|
</dd>
|
|
|
|
{{/let}}
|
2020-10-14 08:03:39 +00:00
|
|
|
</dl>
|
2022-02-10 15:28:26 +00:00
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|