From 8a0814062b44474e97488dfd7200b6f9d95f297d Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 17 Apr 2024 12:41:48 +0530 Subject: [PATCH] mgr/dashboard: fix dashboard not visible on disabled anonymous access 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 (cherry picked from commit f802e99c1e743675bc9b4d8c6d3399879391135f) --- .../src/app/shared/components/grafana/grafana.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b650f6694cf5c..d3c7012bcbb3c 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 @@ -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 { -- 2.39.5