Kenia 8077a41f42 ui: Make only existing services in Upstreams linkabled with hover effect (#7943)
* Create service/exist helper to be used in ListCollection list items

* Make only existing services in Upstreams linkabled with hover effect
2020-06-03 16:46:47 +00:00

53 lines
1.6 KiB
Handlebars

<div id="upstreams" class="tab-section">
<div role="tabpanel">
{{#if (gt gateway.Services.length 0)}}
<section>
<p>
Upstreams are services that may receive traffic from this gateway. Learn more about configuring gateways in our <a href="{{env 'CONSUL_DOCS_URL'}}/connect/ingress_gateway.html" target="_blank" rel="noopener noreferrer">documentation</a>.
</p>
{{#let item.Service.Namespace as |nspace|}}
<ListCollection @items={{gateway.Services}} class="consul-upstream-list" as |item index|>
{{#if (service/exists item)}}
<a data-test-service-name href={{href-to 'dc.services.show' item.Name}}>
{{item.Name}}
</a>
{{else}}
<p data-test-service-name>
{{item.Name}}
</p>
{{/if}}
<ul>
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
{{#if (not-eq item.Namespace nspace)}}
<li class="nspace">
{{item.Namespace}}
<Tooltip>
Namespace
</Tooltip>
</li>
{{/if}}
{{/if}}
{{#if (not-eq item.GatewayConfig.ListenerPort 0)}}
<li class="port">
<span>:{{item.GatewayConfig.ListenerPort}}</span>
<CopyButton
@value={{item.GatewayConfig.ListenerPort}}
@name="Port"
/>
<Tooltip>
Port
</Tooltip>
</li>
{{/if}}
</ul>
</ListCollection>
{{/let}}
</section>
{{else}}
<p>
There are no upstreams.
</p>
{{/if}}
</div>
</div>