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

81 lines
2.3 KiB
Handlebars

{{#if (gt items.length 0)}}
<ListCollection @items={{items}} class="consul-service-instance-list" as |item index|>
<BlockSlot @name="header">
{{#if (eq routeName "dc.services.show")}}
<a data-test-service-name href={{href-to routeName item.Service}}>
{{item.ID}}
</a>
{{else}}
<a data-test-service-name href={{href-to routeName item.Service.Service item.Node.Node (or item.Service.ID item.Service.Service)}}>
{{item.Service.ID}}
</a>
{{/if}}
</BlockSlot>
<BlockSlot @name="details">
{{#if checks}}
<ConsulExternalSource @item={{item}} />
<ConsulInstanceChecks @type="service" @items={{get checks item.Service}} />
{{else}}
<ConsulExternalSource @item={{item.Service}} />
<ConsulInstanceChecks @type="service" @items={{filter-by 'ServiceID' '' item.Checks}} />
<ConsulInstanceChecks @type="node" @items={{reject-by 'ServiceID' '' item.Checks}} />
{{/if}}
{{#if (get proxies item.Service.ID)}}
<dl class="proxy">
<dt>
<Tooltip>
Proxy
</Tooltip>
</dt>
<dd data-test-proxy>
connected with proxy
</dd>
</dl>
{{/if}}
{{#if (gt item.Node.Node.length 0)}}
<dl class="node">
<dt>
<Tooltip>
Node
</Tooltip>
</dt>
<dd>
<a href={{href-to 'dc.nodes.show' item.Node.Node}}>{{item.Node.Node}}</a>
</dd>
</dl>
{{/if}}
{{#if item.Service.Port}}
<dl class="address" data-test-address>
<dt>
<Tooltip>
IP Address and Port
</Tooltip>
</dt>
<dd>
{{#if (not-eq item.Service.Address '')}}
{{item.Service.Address}}:{{item.Service.Port}}
{{else}}
{{item.Node.Address}}:{{item.Service.Port}}
{{/if}}
</dd>
</dl>
{{/if}}
{{#if (and checks item.Port)}}
<dl>
<dt>
<CopyButton
@value={{item.Port}}
@name="Port"
/>
</dt>
<dd data-test-service-port={{item.Port}}>:{{item.Port}}</dd>
</dl>
{{/if}}
{{#if checks}}
<TagList @item={{item}} />
{{else}}
<TagList @item={{item.Service}} />
{{/if}}
</BlockSlot>
</ListCollection>
{{/if}}