From 8a7cc9da2af63cfb21439c37273bb7b6a1be23b5 Mon Sep 17 00:00:00 2001 From: Avan Thakkar Date: Tue, 9 Feb 2021 13:31:59 +0530 Subject: [PATCH] mgr/dashboard: avoid using document.write() Fixes: https://tracker.ceph.com/issues/49220 Signed-off-by: Avan Thakkar (cherry picked from commit 36efe519b90b7508fb830f2c250e8b6956eaaf05) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/app.module.ts - Adopt the master branch changes. --- src/pybind/mgr/dashboard/frontend/src/app/app.module.ts | 5 +++++ src/pybind/mgr/dashboard/frontend/src/index.html | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts index 7b63f06b7bd1c..55211e0183943 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts @@ -1,3 +1,4 @@ +import { APP_BASE_HREF } from '@angular/common'; import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; import { ErrorHandler, @@ -57,6 +58,10 @@ import { environment } from '../environments/environment'; useClass: ApiInterceptorService, multi: true }, + { + provide: APP_BASE_HREF, + useValue: window['base-href'] + }, { provide: TRANSLATIONS, useFactory: (locale) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/index.html b/src/pybind/mgr/dashboard/frontend/src/index.html index 05a8f70911674..8d5196e35e6c7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/index.html +++ b/src/pybind/mgr/dashboard/frontend/src/index.html @@ -3,9 +3,10 @@ Ceph + -- 2.39.5