diff --git a/ui/packages/consul-peerings/app/controllers/dc/peers/edit/index.js b/ui/packages/consul-peerings/app/controllers/dc/peers/edit/index.js index d262ef02b..0f4af5e82 100644 --- a/ui/packages/consul-peerings/app/controllers/dc/peers/edit/index.js +++ b/ui/packages/consul-peerings/app/controllers/dc/peers/edit/index.js @@ -5,11 +5,7 @@ import { action } from "@ember/object"; export default class DcPeersEditIndexController extends Controller { @service router; - @action transitionToStartSubRouteByType(peerModel) { - if (peerModel.isDialer) { - this.router.replaceWith("dc.peers.edit.exported"); - } else { - this.router.replaceWith("dc.peers.edit.imported"); - } + @action transitionToImported() { + this.router.replaceWith("dc.peers.edit.imported"); } } diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/edit/exported.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/edit/exported.hbs index a525b841f..246097f77 100644 --- a/ui/packages/consul-peerings/app/templates/dc/peers/edit/exported.hbs +++ b/ui/packages/consul-peerings/app/templates/dc/peers/edit/exported.hbs @@ -31,6 +31,7 @@ @type="search" @value={{this.search}} placeholder="Search" + class="rounded-sm border-hds-border-faint" {{on "input" (pick "target.value" this.updateSearch)}} /> diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/edit/imported.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/edit/imported.hbs index ebed120b4..1c2d11d5e 100644 --- a/ui/packages/consul-peerings/app/templates/dc/peers/edit/imported.hbs +++ b/ui/packages/consul-peerings/app/templates/dc/peers/edit/imported.hbs @@ -76,6 +76,7 @@ diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/edit/index.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/edit/index.hbs index 75042b439..25acb7e4c 100644 --- a/ui/packages/consul-peerings/app/templates/dc/peers/edit/index.hbs +++ b/ui/packages/consul-peerings/app/templates/dc/peers/edit/index.hbs @@ -1,3 +1,3 @@ - {{did-insert (fn this.transitionToStartSubRouteByType route.model.peer)}} + {{did-insert this.transitionToImported}} \ No newline at end of file diff --git a/ui/packages/consul-ui/app/components/consul/service/list/index.hbs b/ui/packages/consul-ui/app/components/consul/service/list/index.hbs index a97184b98..773af3615 100644 --- a/ui/packages/consul-ui/app/components/consul/service/list/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/service/list/index.hbs @@ -1,97 +1,111 @@ - -
-
- Health -
-
- - {{#if (eq 'critical' item.MeshStatus)}} - At least one health check on one instance is failing. - {{else if (eq 'warning' item.MeshStatus)}} - At least one health check on one instance has a warning. - {{else if (eq 'passing' item.MeshStatus)}} - All health checks are passing. - {{else}} - There are no health checks. - {{/if}} - -
-
-{{#if (gt item.InstanceCount 0)}} - + {{#let + (eq @peer.State 'FAILING') + (and @peer (eq item.InstanceCount 0)) + as |peerIsFailing peeredAndInstanceCountZero| }} - > - {{item.Name}} - -{{else}} -

- {{item.Name}} -

-{{/if}} +
+
+ Health +
+
+ + {{#if peerIsFailing}} + This peer is out of sync, so the current health statuses of its services are unknown. + {{else if peeredAndInstanceCountZero}} + This service currently has 0 instances. Check with the operator of its peer to make + sure this is expected behavior. + {{else if (eq 'critical' item.MeshStatus)}} + At least one health check on one instance is failing. + {{else if (eq 'warning' item.MeshStatus)}} + At least one health check on one instance has a warning. + {{else if (eq 'passing' item.MeshStatus)}} + All health checks are passing. + {{else}} + There are no health checks. + {{/if}} + +
+
+ {{/let}} + {{#if (gt item.InstanceCount 0)}} + + {{item.Name}} + + {{else}} +

+ {{item.Name}} +

+ {{/if}}
- + - {{#if (and (not-eq item.InstanceCount 0) (and (not-eq item.Kind 'terminating-gateway') (not-eq item.Kind 'ingress-gateway'))) }} - - {{format-number item.InstanceCount}} {{pluralize item.InstanceCount 'instance' without-count=true}} - - {{/if}} - - {{#if (eq item.Kind 'terminating-gateway')}} - - {{format-number item.GatewayConfig.AssociatedServiceCount}} {{pluralize item.GatewayConfig.AssociatedServiceCount 'linked service' without-count=true}} - - {{else if (eq item.Kind 'ingress-gateway')}} - - {{format-number item.GatewayConfig.AssociatedServiceCount}} {{pluralize item.GatewayConfig.AssociatedServiceCount 'upstream' without-count=true}} - - {{/if}} - {{#if (or item.ConnectedWithGateway item.ConnectedWithProxy)}} -
-
- - This service uses a proxy for the Consul service mesh - -
- {{#if (and item.ConnectedWithGateway item.ConnectedWithProxy )}} -
- in service mesh with proxy and gateway -
- {{else if item.ConnectedWithProxy}} -
- in service mesh with proxy -
- {{else if item.ConnectedWithGateway}} -
- in service mesh with gateway -
- {{/if}} -
- {{/if}} + {{#if + (and + (not-eq item.InstanceCount 0) + (and (not-eq item.Kind 'terminating-gateway') (not-eq item.Kind 'ingress-gateway')) + ) + }} + + {{format-number item.InstanceCount}} + {{pluralize item.InstanceCount 'instance' without-count=true}} + + {{/if}} + {{#unless @peer}} + + {{/unless}} + {{#if (eq item.Kind 'terminating-gateway')}} + + {{format-number item.GatewayConfig.AssociatedServiceCount}} + {{pluralize item.GatewayConfig.AssociatedServiceCount 'linked service' without-count=true}} + + {{else if (eq item.Kind 'ingress-gateway')}} + + {{format-number item.GatewayConfig.AssociatedServiceCount}} + {{pluralize item.GatewayConfig.AssociatedServiceCount 'upstream' without-count=true}} + + {{/if}} + {{#if (or item.ConnectedWithGateway item.ConnectedWithProxy)}} +
+
+ + This service uses a proxy for the Consul service mesh + +
+ {{#if (and item.ConnectedWithGateway item.ConnectedWithProxy)}} +
+ in service mesh with proxy and gateway +
+ {{else if item.ConnectedWithProxy}} +
+ in service mesh with proxy +
+ {{else if item.ConnectedWithGateway}} +
+ in service mesh with gateway +
+ {{/if}} +
+ {{/if}}
\ No newline at end of file diff --git a/ui/packages/consul-ui/app/components/icon-definition/index.scss b/ui/packages/consul-ui/app/components/icon-definition/index.scss index 9595850e5..d8d9dda77 100644 --- a/ui/packages/consul-ui/app/components/icon-definition/index.scss +++ b/ui/packages/consul-ui/app/components/icon-definition/index.scss @@ -25,6 +25,11 @@ @extend %with-minus-square-fill-mask, %as-pseudo; color: rgb(var(--tone-gray-500)); } +%icon-definition.empty dt::before, +%composite-row-header .help dd::before { + @extend %with-help-circle-outline-mask, %as-pseudo; + color: rgb(var(--tone-gray-500)); +} %composite-row-header [rel='me'] dd::before { @extend %with-check-circle-fill-mask, %as-pseudo; diff --git a/ui/packages/consul-ui/app/services/repository/peer.js b/ui/packages/consul-ui/app/services/repository/peer.js index 838de8fb1..c39accbb5 100644 --- a/ui/packages/consul-ui/app/services/repository/peer.js +++ b/ui/packages/consul-ui/app/services/repository/peer.js @@ -107,16 +107,22 @@ export default class PeerService extends RepositoryService { }} ` )((headers, body, cache) => { + // we can't easily use fragments as we are working around the serializer + // layer const { StreamStatus } = body; - if (StreamStatus.LastHeartbeat) { - StreamStatus.LastHeartbeat = new Date(StreamStatus.LastHeartbeat); - } - if (StreamStatus.LastReceive) { - StreamStatus.LastReceive = new Date(StreamStatus.LastReceive); - } - if (StreamStatus.LastSend) { - StreamStatus.LastSend = new Date(StreamStatus.LastSend); + + if (StreamStatus) { + if (StreamStatus.LastHeartbeat) { + StreamStatus.LastHeartbeat = new Date(StreamStatus.LastHeartbeat); + } + if (StreamStatus.LastReceive) { + StreamStatus.LastReceive = new Date(StreamStatus.LastReceive); + } + if (StreamStatus.LastSend) { + StreamStatus.LastSend = new Date(StreamStatus.LastSend); + } } + return { meta: { version: 2,