ui: Add health check icon to Ingress Upstreams and add Tooltips in additional areas (#8091)

* Add Health Checks and update Tooltips in Ingress Upstreams

* Update Tooltip in Proxy Info tab Upstreams

* Add Tooltips to Proxy Info tab Exposed Paths

* Add Health Checks with Tooltips to Service List page
This commit is contained in:
Kenia 2020-06-12 09:35:52 -04:00 committed by hashicorp-ci
parent 51660ffb25
commit fb1fd730a4
8 changed files with 146 additions and 58 deletions

View File

@ -1,19 +1,34 @@
{{yield}} {{yield}}
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
<ListCollection @items={{items}} class="consul-service-list" as |item index|> <ListCollection @items={{items}} class="consul-service-list" as |item index|>
{{#if (eq item.Kind 'terminating-gateway')}} <li>
<a data-test-service-name href={{href-to "dc.services.show.services" item.Name}} class={{service/health-checks item}}> <span class={{service/health-checks item}}>
<Tooltip>
{{#if (eq 'critical' (service/health-checks item))}}
At least one health check on one instance is failing.
{{else if (eq 'warning' (service/health-checks item))}}
At least one health check on one instance has a warning.
{{else if (eq 'passing' (service/health-checks item))}}
All health checks are passing.
{{else}}
There are no health checks.
{{/if}}
</Tooltip>
</span>
{{#if (eq item.Kind 'terminating-gateway')}}
<a data-test-service-name href={{href-to "dc.services.show.services" item.Name}}>
{{item.Name}} {{item.Name}}
</a> </a>
{{else if (eq item.Kind 'ingress-gateway')}} {{else if (eq item.Kind 'ingress-gateway')}}
<a data-test-service-name href={{href-to "dc.services.show.upstreams" item.Name}} class={{service/health-checks item}}> <a data-test-service-name href={{href-to "dc.services.show.upstreams" item.Name}}>
{{item.Name}} {{item.Name}}
</a> </a>
{{else}} {{else}}
<a data-test-service-name href={{href-to "dc.services.show.instances" item.Name}} class={{service/health-checks item}}> <a data-test-service-name href={{href-to "dc.services.show.instances" item.Name}}>
{{item.Name}} {{item.Name}}
</a> </a>
{{/if}} {{/if}}
</li>
<ul> <ul>
{{#if (and nspace (env 'CONSUL_NSPACES_ENABLED'))}} {{#if (and nspace (env 'CONSUL_NSPACES_ENABLED'))}}
{{#if (not-eq item.Namespace nspace)}} {{#if (not-eq item.Namespace nspace)}}

View File

@ -1,3 +1,3 @@
<EmberTooltip @popperContainer=".app-view"> <EmberTooltip @popperContainer=".app-view" @side="top-start">
{{yield}} {{yield}}
</EmberTooltip> </EmberTooltip>

View File

@ -54,4 +54,5 @@
// Ember Tooltips // Ember Tooltips
.ember-tooltip { .ember-tooltip {
padding: 12px; padding: 12px;
max-width: 192px;
} }

View File

@ -6,7 +6,8 @@
@extend %composite-row-intent; @extend %composite-row-intent;
} }
%composite-row > a, %composite-row > a,
%composite-row > p { %composite-row > p,
%composite-row > li > * {
@extend %composite-row-header; @extend %composite-row-header;
} }
%composite-row > ul { %composite-row > ul {

View File

@ -19,13 +19,23 @@
%composite-row-detail * { %composite-row-detail * {
white-space: nowrap; white-space: nowrap;
} }
%composite-row-detail > li:not(:first-child) { %composite-row-detail > li {
margin-left: 12px; margin-right: 12px;
} }
%composite-row-detail .node::before { %composite-row-detail .node::before {
margin-top: 2px; margin-top: 2px;
} }
//Health Checks
%composite-row > li > span.passing::before,
%composite-row > li > span.warning::before,
%composite-row > li > span.critical::before,
%composite-row > li > span.empty::before {
height: 18px;
width: 18px;
margin-top: 2px;
}
// Copy Button with Feedback // Copy Button with Feedback
%composite-row .copy-button button { %composite-row .copy-button button {
padding: 0 !important; padding: 0 !important;

View File

@ -56,23 +56,23 @@
@extend %with-swap-horizontal-mask, %as-pseudo; @extend %with-swap-horizontal-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }
%composite-row .datacenter::before { %composite-row li.datacenter > span:first-child::before {
@extend %with-user-organization-mask, %as-pseudo; @extend %with-user-organization-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }
%composite-row .nspace::before { %composite-row-detail li.nspace > span:first-child::before {
@extend %with-folder-outline-mask, %as-pseudo; @extend %with-folder-outline-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }
%composite-row-detail .path::before { %composite-row-detail li.path > span:first-child::before {
@extend %with-path-mask, %as-pseudo; @extend %with-path-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }
%composite-row-detail .port::before { %composite-row-detail li.port > span:first-child::before {
@extend %with-port-mask, %as-pseudo; @extend %with-port-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }
%composite-row-detail .protocol::before { %composite-row-detail li.protocol > span:first-child::before {
@extend %with-protocol-mask, %as-pseudo; @extend %with-protocol-mask, %as-pseudo;
background-color: $gray-500; background-color: $gray-500;
} }

View File

@ -14,32 +14,44 @@
{{#if (env 'CONSUL_NSPACES_ENABLED')}} {{#if (env 'CONSUL_NSPACES_ENABLED')}}
{{#if (not-eq item.DestinationType 'prepared_query')}} {{#if (not-eq item.DestinationType 'prepared_query')}}
<li class="nspace"> <li class="nspace">
{{or item.DestinationNamespace 'default'}} <span>
<Tooltip> <Tooltip>
Namespace Namespace
</Tooltip> </Tooltip>
</span>
<span>
{{or item.DestinationNamespace 'default'}}
</span>
</li> </li>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (and (not-eq item.Datacenter proxyDatacenter) (not-eq item.Datacenter ""))}} {{#if (and (not-eq item.Datacenter proxyDatacenter) (not-eq item.Datacenter ""))}}
<li class="datacenter"> <li class="datacenter">
{{item.Datacenter}} <span>
<Tooltip> <Tooltip>
Datacenter Datacenter
</Tooltip> </Tooltip>
</span>
<span>
{{item.Datacenter}}
</span>
</li> </li>
{{/if}} {{/if}}
{{#if (gt item.LocalBindPort 0)}} {{#if (gt item.LocalBindPort 0)}}
{{#let (concat (or item.LocalBindAddress '127.0.0.1') ':' item.LocalBindPort) as |combinedAddress| }} {{#let (concat (or item.LocalBindAddress '127.0.0.1') ':' item.LocalBindPort) as |combinedAddress| }}
<li class="port"> <li class="port">
<span>
<Tooltip>
Address
</Tooltip>
</span>
<span>
<span>{{combinedAddress}}</span> <span>{{combinedAddress}}</span>
<CopyButton <CopyButton
@value={{combinedAddress}} @value={{combinedAddress}}
@name="Address" @name="Address"
/> />
<Tooltip> </span>
Address
</Tooltip>
</li> </li>
{{/let}} {{/let}}
{{/if}} {{/if}}
@ -73,22 +85,50 @@
<ul> <ul>
{{#if path.Protocol}} {{#if path.Protocol}}
<li class="protocol"> <li class="protocol">
<span>
<Tooltip>
Protocol
</Tooltip>
</span>
<span>
{{path.Protocol}} {{path.Protocol}}
</span>
</li> </li>
{{/if}} {{/if}}
{{#if path.ListenerPort}} {{#if path.ListenerPort}}
<li class="port"> <li class="port">
<span>
<Tooltip>
Port
</Tooltip>
</span>
<span>
listening on :{{path.ListenerPort}} listening on :{{path.ListenerPort}}
</span>
</li> </li>
{{/if}} {{/if}}
{{#if path.LocalPathPort}} {{#if path.LocalPathPort}}
<li class="port"> <li class="port">
<span>
<Tooltip>
Port
</Tooltip>
</span>
<span>
local port :{{path.LocalPathPort}} local port :{{path.LocalPathPort}}
</span>
</li> </li>
{{/if}} {{/if}}
{{#if path.Path}} {{#if path.Path}}
<li class="path"> <li class="path">
<span>
<Tooltip>
Path
</Tooltip>
</span>
<span>
{{path.Path}} {{path.Path}}
</span>
</li> </li>
{{/if}} {{/if}}
</ul> </ul>

View File

@ -9,8 +9,22 @@
<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)}}
{{#let item.Namespace as |gatewayNspace|}} {{#let item.Namespace as |gatewayNspace|}}
<li>
<span class={{service/health-checks item}}>
<Tooltip>
{{#if (eq 'critical' (service/health-checks item))}}
At least one health check on one instance is failing.
{{else if (eq 'warning' (service/health-checks item))}}
At least one health check on one instance has a warning.
{{else if (eq 'passing' (service/health-checks item))}}
All health checks are passing.
{{else}}
There are no health checks.
{{/if}}
</Tooltip>
</span>
{{#if (and (env 'CONSUL_NSPACES_ENABLED') (not-eq gatewayNspace nspace))}} {{#if (and (env 'CONSUL_NSPACES_ENABLED') (not-eq gatewayNspace nspace))}}
<a data-test-service-name href={{href-to 'nspace.dc.services.show' (concat '~' gatewayNspace) dc item.Name}}> <a data-test-service-name href={{href-to 'nspace.dc.services.show' (concat '~' gatewayNspace) dc item.Name }}>
{{item.Name}} {{item.Name}}
</a> </a>
{{else}} {{else}}
@ -18,6 +32,7 @@
{{item.Name}} {{item.Name}}
</a> </a>
{{/if}} {{/if}}
</li>
{{/let}} {{/let}}
{{else}} {{else}}
<p data-test-service-name> <p data-test-service-name>
@ -25,26 +40,32 @@
</p> </p>
{{/if}} {{/if}}
<ul> <ul>
{{#if (env 'CONSUL_NSPACES_ENABLED')}} {{#if (and (env 'CONSUL_NSPACES_ENABLED') (not-eq item.Namespace nspace))}}
{{#if (not-eq item.Namespace nspace)}}
<li class="nspace"> <li class="nspace">
{{item.Namespace}} <span>
<Tooltip> <Tooltip>
Namespace Namespace
</Tooltip> </Tooltip>
</span>
<span>
{{item.Namespace}}
</span>
</li> </li>
{{/if}} {{/if}}
{{/if}}
{{#if (not-eq item.GatewayConfig.ListenerPort 0)}} {{#if (not-eq item.GatewayConfig.ListenerPort 0)}}
<li class="port"> <li class="port">
<span>
<Tooltip>
Port
</Tooltip>
</span>
<span>
<span>:{{item.GatewayConfig.ListenerPort}}</span> <span>:{{item.GatewayConfig.ListenerPort}}</span>
<CopyButton <CopyButton
@value={{item.GatewayConfig.ListenerPort}} @value={{item.GatewayConfig.ListenerPort}}
@name="Port" @name="Port"
/> />
<Tooltip> </span>
Port
</Tooltip>
</li> </li>
{{/if}} {{/if}}
</ul> </ul>