ui: Customize link for an Upstream in a different namespace as the ingress gateway (#8006)

* Add configuration default value for findGatewayBySlug

* Customize link for an Upstream in a different nspace as the ingress gateway
This commit is contained in:
Kenia 2020-06-03 11:29:53 -04:00 committed by John Cowen
parent bb69b0f4d6
commit f4e38d229b
2 changed files with 12 additions and 4 deletions

View File

@ -76,7 +76,7 @@ export default RepositoryService.extend({
throw e; throw e;
}); });
}, },
findGatewayBySlug: function(slug, dc, nspace, configuration) { findGatewayBySlug: function(slug, dc, nspace, configuration = {}) {
const query = { const query = {
dc: dc, dc: dc,
ns: nspace, ns: nspace,

View File

@ -8,9 +8,17 @@
{{#let item.Service.Namespace as |nspace|}} {{#let item.Service.Namespace as |nspace|}}
<ListCollection @items={{gatewayServices}} class="consul-upstream-list" as |item index|> <ListCollection @items={{gatewayServices}} class="consul-upstream-list" as |item index|>
{{#if (service/exists item)}} {{#if (service/exists item)}}
<a data-test-service-name href={{href-to 'dc.services.show' item.Name}}> {{#let item.Namespace as |gatewayNspace|}}
{{item.Name}} {{#if (and (env 'CONSUL_NSPACES_ENABLED') (not-eq gatewayNspace nspace))}}
</a> <a data-test-service-name href={{href-to 'nspace.dc.services.show' (concat '~' gatewayNspace) dc item.Name}}>
{{item.Name}}
</a>
{{else}}
<a data-test-service-name href={{href-to 'dc.services.show' item.Name}}>
{{item.Name}}
</a>
{{/if}}
{{/let}}
{{else}} {{else}}
<p data-test-service-name> <p data-test-service-name>
{{item.Name}} {{item.Name}}