ui: Add EmptyState for exposed paths, plus additional details (#9445)

* ui: Add EmptyState for exposed paths, plus additional details

1. Add the port to the combined address
2. Use the proxy address for the ip address used

* Convert to glimmer component

* Add spaces to ListenerPort and LocalPathPort Tooltips
This commit is contained in:
John Cowen 2021-01-05 16:59:16 +00:00 committed by GitHub
parent 3925713767
commit a42e844ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 29 deletions

View File

@ -1,35 +1,27 @@
{{#if @for}}
{{#if @for~}}
<label
for={{@for}}
...attributes
>
{{yield}}
</label>
{{else if @href}}
{{#if @external}}
>{{yield}}</label>
{{~else if @href~}}
{{~#if @external~}}
<a
href={{@href}}
target="_blank"
rel="noopener noreferrer"
...attributes
>
{{yield}}
</a>
{{else}}
>{{yield}}</a>
{{~else~}}
<a
href={{@href}}
...attributes
>
{{yield}}
</a>
{{/if}}
{{else}}
>{{yield}}</a>
{{~/if~}}
{{~else~}}
<button
tabindex="-1"
type="button"
{{on 'click' (optional @onclick)}}
...attributes
>
{{yield}}
</button>
{{/if}}
>{{yield}}</button>
{{~/if}}

View File

@ -8,7 +8,7 @@
{{#each @items as |path|}}
<li>
<div class="header">
{{#let (concat address ':' path.Path) as |combinedAddress|}}
{{#let (concat @address ':' path.ListenerPort path.Path) as |combinedAddress|}}
<p class="combined-address">
<span>
{{combinedAddress}}
@ -37,7 +37,7 @@
<dl class="port">
<dt>
<Tooltip>
Port
Listener Port
</Tooltip>
</dt>
<dd>
@ -49,7 +49,7 @@
<dl class="port">
<dt>
<Tooltip>
Port
Local Path Port
</Tooltip>
</dt>
<dd>
@ -61,7 +61,7 @@
<dl class="path">
<dt>
<Tooltip>
Path
Path
</Tooltip>
</dt>
<dd>

View File

@ -1,5 +0,0 @@
import Component from '@ember/component';
export default Component.extend({
tagName: '',
});

View File

@ -3,6 +3,14 @@
<p>
The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation.
</p>
<Consul::ExposedPath::List @items={{proxy.Service.Proxy.Expose.Paths}} @address={{item.Address}} />
<Consul::ExposedPath::List @items={{proxy.Service.Proxy.Expose.Paths}} @address={{proxy.Address}} />
{{else}}
<EmptyState>
<BlockSlot @name="body">
<p>
There are no individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our <Action @href={{concat (env 'CONSUL_DOCS_URL') '/connect/registration/service-registration#expose-paths-configuration-reference'}} @external={{true}}>documentation</Action>.
</p>
</BlockSlot>
</EmptyState>
{{/if}}
</div>