From 78b704be87e8298b8520d0d4c21e97fe311b070c Mon Sep 17 00:00:00 2001
From: Kenia <19161242+kaxcode@users.noreply.github.com>
Date: Fri, 13 Nov 2020 10:39:00 -0500
Subject: [PATCH] ui: Pass down nspace and dc from Service model down to
prometheus request (#9175)
* Pass down nspace and dc from Service model down to prometheus request
* Reviewing notes fix-ups
* Fix on dc/nspace to send from upstream/downstream card
---
.../app/components/topology-metrics/card.hbs | 6 +++++-
.../app/components/topology-metrics/index.hbs | 16 ++++++++++------
.../components/topology-metrics/series/index.hbs | 2 +-
.../components/topology-metrics/stats/index.hbs | 2 +-
.../app/templates/dc/services/show/topology.hbs | 2 ++
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/ui/packages/consul-ui/app/components/topology-metrics/card.hbs b/ui/packages/consul-ui/app/components/topology-metrics/card.hbs
index 473de730dc..e207b38030 100644
--- a/ui/packages/consul-ui/app/components/topology-metrics/card.hbs
+++ b/ui/packages/consul-ui/app/components/topology-metrics/card.hbs
@@ -7,7 +7,7 @@
{{@item.Name}}
- {{#if (and (and nspace (env 'CONSUL_NSPACES_ENABLED')) @type)}}
+ {{#if (and (and @nspace (env 'CONSUL_NSPACES_ENABLED')) @type)}}
-
@@ -47,6 +47,8 @@
{{#if (and @hasMetricsProvider (not-eq @service.Kind 'ingress-gateway'))}}
{{#if (eq @type 'upstream')}}
{{else}}
-
{{@topology.Datacenter}}
+
{{@dc}}
Only showing downstreams within the current datacenter for {{@service.Service.Service}}.
@@ -17,9 +17,10 @@
{{#each @topology.Downstreams as |item|}}
@@ -32,16 +33,18 @@
{{#if this.hasMetricsProvider }}
{{#if (not-eq @service.Service.Kind 'ingress-gateway')}}
@@ -73,9 +76,10 @@
{{dc}}
{{#each upstreams as |item|}}
diff --git a/ui/packages/consul-ui/app/components/topology-metrics/stats/index.hbs b/ui/packages/consul-ui/app/components/topology-metrics/stats/index.hbs
index c3eab51064..c36d14112d 100644
--- a/ui/packages/consul-ui/app/components/topology-metrics/stats/index.hbs
+++ b/ui/packages/consul-ui/app/components/topology-metrics/stats/index.hbs
@@ -1,6 +1,6 @@
{{#unless @noMetricsReason}}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs
index 4a6fdaa29c..99eb63a47d 100644
--- a/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs
+++ b/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs
@@ -5,6 +5,8 @@
{{/if}}
{{#if topology}}