]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix dashboard not visible on disabled anonymous access 56965/head
authorNizamudeen A <nia@redhat.com>
Wed, 17 Apr 2024 07:11:48 +0000 (12:41 +0530)
committerAdam King <adking@redhat.com>
Wed, 17 Apr 2024 17:48:40 +0000 (13:48 -0400)
When the anonymous access is disabled, the dashboards will have a
password so the verification error code can be 401 (Unauthorized)

Fixes: https://tracker.ceph.com/issues/65534
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit f802e99c1e743675bc9b4d8c6d3399879391135f)

src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts

index b650f6694cf5cc442c0d651b7a81130846c32d27..d3c7012bcbb3cf402a7f65cd2f70952c04f9a636 100644 (file)
@@ -172,7 +172,7 @@ export class GrafanaComponent implements OnInit, OnChanges {
   getFrame() {
     this.settingsService
       .validateGrafanaDashboardUrl(this.uid)
-      .subscribe((data: any) => (this.dashboardExist = data === 200));
+      .subscribe((data: any) => (this.dashboardExist = data === 200 || data === 401)); // 401 because grafana API shows unauthorized when anonymous access is disabled
     if (this.type === 'metrics') {
       this.url = `${this.baseUrl}${this.uid}/${this.grafanaPath}&refresh=2s&var-datasource=${this.datasource}${this.mode}&${this.time}`;
     } else {