diff --git a/ui/packages/consul-ui/app/components/topology-metrics/series/index.hbs b/ui/packages/consul-ui/app/components/topology-metrics/series/index.hbs index 2d32390724..fda4fdeef3 100644 --- a/ui/packages/consul-ui/app/components/topology-metrics/series/index.hbs +++ b/ui/packages/consul-ui/app/components/topology-metrics/series/index.hbs @@ -8,20 +8,22 @@ {{on-window 'resize' (action 'redraw')}} -{{#if data.labels}} -Key +{{#if (not empty)}} + {{#if data.labels}} + Key + {{/if}} {{/if}}
Timestamp
- {{#unless data}} + {{#if empty}} - {{/unless}} + {{/if}}
diff --git a/ui/packages/consul-ui/app/components/topology-metrics/series/index.js b/ui/packages/consul-ui/app/components/topology-metrics/series/index.js index 42b2673ee3..238e0d6657 100644 --- a/ui/packages/consul-ui/app/components/topology-metrics/series/index.js +++ b/ui/packages/consul-ui/app/components/topology-metrics/series/index.js @@ -7,6 +7,7 @@ import { scaleLinear, scaleTime, scaleOrdinal } from 'd3-scale'; import { schemeTableau10 } from 'd3-scale-chromatic'; import { area, stack, stackOrderReverse } from 'd3-shape'; import { max, extent, bisector } from 'd3-array'; +import { set } from '@ember/object'; dayjs.extend(Calendar); @@ -21,7 +22,7 @@ function niceTimeWithSeconds(d) { export default Component.extend({ data: null, - + empty: false, actions: { redraw: function(evt) { this.drawGraphs(); @@ -35,6 +36,7 @@ export default Component.extend({ drawGraphs: function() { if (!this.data) { + set(this, 'empty', true); return; } @@ -59,10 +61,10 @@ export default Component.extend({ if (series.length == 0 || keys.length == 0) { // Put the graph in an error state that might get fixed if metrics show up // on next poll. - let loader = this.element.querySelector('.sparkline-loader'); - loader.innerHTML = 'No Metrics Available'; - loader.style.display = 'block'; + set(this, 'empty', true); return; + } else { + set(this, 'empty', false); } let st = stack()