]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: dashboard not working with a URL prefix 41634/head
authorAvan Thakkar <athakkar@localhost.localdomain>
Wed, 5 May 2021 18:58:46 +0000 (00:28 +0530)
committerAvan Thakkar <athakkar@localhost.localdomain>
Tue, 1 Jun 2021 16:44:09 +0000 (22:14 +0530)
Fixes: https://tracker.ceph.com/issues/50655
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit 94c9840ed094e0b63530daca0f2679095caa74fb)

src/pybind/mgr/dashboard/frontend/src/app/app.module.ts
src/pybind/mgr/dashboard/frontend/src/index.html

index 2f59a0175ac730999db86feedd7beb744c947442..970f3a112e164e9f28cb9fcf94cc687fcfa12a7a 100644 (file)
@@ -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.location.pathname.split('/', 1)[1] || '')
     }
   ],
   bootstrap: [AppComponent]
index bfd6d3ecd83731e1dd316c07d008740c1ca125f9..183202cfed4a560ba14eec3ea1570d4c90e10e35 100644 (file)
@@ -4,10 +4,6 @@
   <meta charset="utf-8">
   <title>Ceph</title>
 
-  <script>
-    document.write('<base href="' + document.location+ '" />');
-  </script>
-
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <link rel="icon" type="image/x-icon" id="cdFavicon" href="favicon.ico">
 </head>