consul/ui-v2/app/templates/components/healthchecked-resource.hbs

39 lines
1.3 KiB
Handlebars

<StatsCard>
<BlockSlot @name="icon">{{yield}}</BlockSlot>
<BlockSlot @name="mini-stat">
{{#if (eq checks.length 0)}}
<span class="zero" data-tooltip="This node has no registered healthchecks">{{checks.length}}</span>
{{else if (eq checks.length healthy.length)}}
<span class="non-zero" data-tooltip={{concat 'All ' healthy.length ' ' (pluralize healthy.length 'check' without-count=true) ' passing'}}>{{healthy.length}}</span>
{{/if}}
</BlockSlot>
<BlockSlot @name="header">
<a href={{href}}>
<strong>{{name}}</strong>
<span>{{address}}</span>
</a>
</BlockSlot>
<BlockSlot @name="body">
{{#if (not-eq checks.length healthy.length)}}
<ul>
{{#each unhealthy as |item|}}
<li>
<a href={{href}} class={{item.Status}}>
<strong data-tooltip={{capitalize item.Status}}>{{capitalize item.Status}}</strong>
<span>{{item.Name}}</span>
</a>
</li>
{{/each}}
{{#if (gt healthy.length 0)}}
<li>
<a href={{href}} class="passing">
<strong data-tooltip={{concat healthy.length ' other passing ' (pluralize healthy.length 'check' without-count=true)}}></strong>
<span>{{healthy.length}} other passing {{pluralize healthy.length 'check' without-count=true}}</span>
</a>
</li>
{{/if}}
</ul>
{{/if}}
</BlockSlot>
</StatsCard>