]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
f2f8b1eb8c97812bbacd2c446c3fcc53b5a61e2a
[ceph.git] /
1 import { Component, OnInit } from '@angular/core';
2
3 import { CephReleaseNamePipe } from '../../pipes/ceph-release-name.pipe';
4 import { SummaryService } from '../../services/summary.service';
5
6 @Component({
7   selector: 'cd-orchestrator-doc-panel',
8   templateUrl: './orchestrator-doc-panel.component.html',
9   styleUrls: ['./orchestrator-doc-panel.component.scss']
10 })
11 export class OrchestratorDocPanelComponent implements OnInit {
12   docsUrl: string;
13
14   constructor(
15     private cephReleaseNamePipe: CephReleaseNamePipe,
16     private summaryService: SummaryService
17   ) {}
18
19   ngOnInit() {
20     const subs = this.summaryService.subscribe((summary: any) => {
21       if (!summary) {
22         return;
23       }
24
25       const releaseName = this.cephReleaseNamePipe.transform(summary.version);
26       this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/orchestrator_cli/`;
27
28       setTimeout(() => {
29         subs.unsubscribe();
30       }, 0);
31     });
32   }
33 }