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

View File

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

View File

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

View File

@ -3,6 +3,14 @@
<p> <p>
The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation. The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation.
</p> </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}} {{/if}}
</div> </div>