consul/ui-v2/app/templates/components/healthchecked-resource.hbs
John Cowen 24847b169e ui: Leader icon for node listing view (#6265)
- yarn upgrade consul-api-double which includes `status/leader`
- add all the ember-data things required to call a new endpoint
- Pass the new leader variable through to the template
- use the new leader variable in the template to set a leader
- add acceptance testing to verify leaders are highlighted
- Change testing navigation/api requests to status/leader (on the node listing page, status/leader is now the last get request to
be called).
- Template whitespace commit (less indenting)
- adds a test to to assert no errors happen with an unelected leader
2019-09-04 08:35:16 +00:00

39 lines
1.4 KiB
Handlebars

{{#stats-card}}
{{#block-slot 'icon'}}{{yield}}{{/block-slot}}
{{#block-slot '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}}
{{/block-slot}}
{{#block-slot 'header'}}
<a href={{href}}>
<strong>{{name}}</strong>
<span>{{address}}</span>
</a>
{{/block-slot}}
{{#block-slot '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}}
{{/block-slot}}
{{/stats-card}}