BigW Consortium Gitlab

Commit afc1a67d by kushalpandya

Handle response failure case for loadActiveMetrics

parent 4826ae07
/* eslint-disable class-methods-use-this, promise/catch-or-return */
export default class PrometheusMetrics { export default class PrometheusMetrics {
constructor(wrapperSelector) { constructor(wrapperSelector) {
this.backOffRequestCounter = 0; this.backOffRequestCounter = 0;
...@@ -24,6 +22,7 @@ export default class PrometheusMetrics { ...@@ -24,6 +22,7 @@ export default class PrometheusMetrics {
this.$panelToggle.on('click', e => this.handlePanelToggle(e)); this.$panelToggle.on('click', e => this.handlePanelToggle(e));
} }
/* eslint-disable class-methods-use-this */
handlePanelToggle(e) { handlePanelToggle(e) {
const $toggleBtn = $(e.currentTarget); const $toggleBtn = $(e.currentTarget);
const $currentPanelBody = $toggleBtn.parents('.panel').find('.panel-body'); const $currentPanelBody = $toggleBtn.parents('.panel').find('.panel-body');
...@@ -84,6 +83,10 @@ export default class PrometheusMetrics { ...@@ -84,6 +83,10 @@ export default class PrometheusMetrics {
this.$monitoredMetricsLoading.addClass('hidden'); this.$monitoredMetricsLoading.addClass('hidden');
this.$monitoredMetricsEmpty.removeClass('hidden'); this.$monitoredMetricsEmpty.removeClass('hidden');
} }
})
.catch(() => {
this.$monitoredMetricsLoading.addClass('hidden');
this.$monitoredMetricsEmpty.removeClass('hidden');
}); });
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment