]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fixes Grafana 500 error 25830/head
authorKanika Murarka <kmurarka@redhat.com>
Tue, 8 Jan 2019 06:45:05 +0000 (12:15 +0530)
committerKanika Murarka <kmurarka@redhat.com>
Tue, 8 Jan 2019 06:45:05 +0000 (12:15 +0530)
Fixes: http://tracker.ceph.com/issues/37809
Signed-off-by: Kanika Murarka <kmurarka@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts

index 7ed2c76e99093d5e03c8eb813c581bf121e7b42a..67875a966c3455f491fa334aaf7c5b7c23d27524 100644 (file)
@@ -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();
+    }
   }
 }