]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/dashboard-help/dashboard-help.component.ts
import 15.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / core / navigation / dashboard-help / dashboard-help.component.ts
index cb6d0085dc91c514cd7ab7babd75999187aa6730..5d212d6cac43b1ca1f20c5615876db635a9db0bd 100644 (file)
@@ -3,9 +3,8 @@ import { Component, OnInit, ViewChild } from '@angular/core';
 import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
 
 import { Icons } from '../../../shared/enum/icons.enum';
-import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
-import { SummaryService } from '../../../shared/services/summary.service';
+import { DocService } from '../../../shared/services/doc.service';
 import { AboutComponent } from '../about/about.component';
 
 @Component({
@@ -21,24 +20,14 @@ export class DashboardHelpComponent implements OnInit {
   icons = Icons;
 
   constructor(
-    private summaryService: SummaryService,
-    private cephReleaseNamePipe: CephReleaseNamePipe,
     private modalService: BsModalService,
-    private authStorageService: AuthStorageService
+    private authStorageService: AuthStorageService,
+    private docService: DocService
   ) {}
 
   ngOnInit() {
-    const subs = this.summaryService.subscribe((summary: any) => {
-      if (!summary) {
-        return;
-      }
-
-      const releaseName = this.cephReleaseNamePipe.transform(summary.version);
-      this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/`;
-
-      setTimeout(() => {
-        subs.unsubscribe();
-      }, 0);
+    this.docService.subscribeOnce('dashboard', (url: string) => {
+      this.docsUrl = url;
     });
   }