From 609fe223d420e31463a5c77bff24496decd6351c Mon Sep 17 00:00:00 2001 From: Kanika Murarka Date: Tue, 8 Jan 2019 12:15:05 +0530 Subject: [PATCH] mgr/dashboard: Fixes Grafana 500 error Fixes: http://tracker.ceph.com/issues/37809 Signed-off-by: Kanika Murarka --- .../shared/components/grafana/grafana.component.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts index 7ed2c76e99093..67875a966c345 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts @@ -65,7 +65,6 @@ export class GrafanaComponent implements OnInit, OnChanges { subs.unsubscribe(); }, 0); }); - this.settingsService.ifSettingConfigured('api/grafana/url', (url) => { this.grafanaExist = true; this.loading = false; @@ -92,17 +91,23 @@ export class GrafanaComponent implements OnInit, OnChanges { } else { this.modeText = 'Return to default'; } - this.getFrame(); + if (this.grafanaExist) { + this.getFrame(); + } this.modeFlag = false; } reset() { this.mode = '&kiosk'; this.modeText = 'Change time selection'; - this.getFrame(); + if (this.grafanaExist) { + this.getFrame(); + } } ngOnChanges(changes) { - this.getFrame(); + if (this.grafanaExist) { + this.getFrame(); + } } } -- 2.39.5