consul/ui-v2/app/components/consul-service-instance-list/index.hbs

47 lines
1.5 KiB
Handlebars

{{yield}}
{{#if (gt items.length 0)}}
<ListCollection @items={{items}} class="consul-service-instance-list" as |item index|>
<a href={{href-to routeName item.Service.Service item.Node.Node (or item.Service.ID item.Service.Service)}}>
{{item.Service.ID}}
</a>
<ul>
<ConsulExternalSource @item={{item.Service}} as |ExternalSource|>
<li>
<ExternalSource />
</li>
</ConsulExternalSource>
{{#with (reject-by 'ServiceID' '' item.Checks) as |checks|}}
<li class={{service/instance-checks checks}}>
{{checks.length}} service checks
</li>
{{/with}}
{{#with (filter-by 'ServiceID' '' item.Checks) as |checks|}}
<li class={{service/instance-checks checks}}>
{{checks.length}} node checks
</li>
{{/with}}
{{#if (get proxies item.Service.ID)}}
<li class="proxy">
connected with proxy
</li>
{{/if}}
{{#if (gt item.Node.Node.length 0)}}
<li class="node">
<a href={{href-to 'dc.nodes.show' item.Node.Node}}>{{item.Node.Node}}</a>
</li>
{{/if}}
<li class="address" data-test-address>
{{#if (not-eq item.Service.Address '')}}
{{item.Service.Address}}:{{item.Service.Port}}
{{else}}
{{item.Node.Address}}:{{item.Service.Port}}
{{/if}}
</li>
<TagList @item={{item.Service}} as |Tags|>
<li>
<Tags />
</li>
</TagList>
</ul>
</ListCollection>
{{/if}}