From 36efe519b90b7508fb830f2c250e8b6956eaaf05 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 --- 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 2f59a0175ac..cbe447bbb54 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, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; @@ -39,6 +40,10 @@ import { SharedModule } from './shared/shared.module'; provide: HTTP_INTERCEPTORS, useClass: ApiInterceptorService, multi: true + }, + { + provide: APP_BASE_HREF, + useValue: window['base-href'] } ], bootstrap: [AppComponent] diff --git a/src/pybind/mgr/dashboard/frontend/src/index.html b/src/pybind/mgr/dashboard/frontend/src/index.html index bfd6d3ecd83..523fce3fc2b 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