From 6712ac9ef60ff9e878afcd3c841930a39edf7529 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 - Adopting 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 1f8e9bf5b1620..b4b902aa0b258 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 { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { ErrorHandler, @@ -58,6 +59,10 @@ import { environment } from '../environments/environment'; useClass: ApiInterceptorService, multi: true }, + { + provide: APP_BASE_HREF, + useValue: window['base-href'] + }, { provide: TRANSLATIONS, useFactory: (locale: string) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/index.html b/src/pybind/mgr/dashboard/frontend/src/index.html index f314e2c53a8f5..150e67eebcb65 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