]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
563f9a24349bbc3ab6285075e3a907dcbf54ce07
[ceph.git] /
1 import { Component, OnInit } from '@angular/core';
2
3 import { BsModalRef, BsModalService } from 'ngx-bootstrap';
4
5 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
6 import { SummaryService } from '../../../shared/services/summary.service';
7 import { AboutComponent } from '../about/about.component';
8
9 @Component({
10   selector: 'cd-dashboard-help',
11   templateUrl: './dashboard-help.component.html',
12   styleUrls: ['./dashboard-help.component.scss']
13 })
14 export class DashboardHelpComponent implements OnInit {
15   docsUrl: string;
16   modalRef: BsModalRef;
17
18   constructor(
19     private summaryService: SummaryService,
20     private cephReleaseNamePipe: CephReleaseNamePipe,
21     private modalService: BsModalService
22   ) {}
23
24   ngOnInit() {
25     const subs = this.summaryService.summaryData$.subscribe((summary: any) => {
26       if (!summary) {
27         return;
28       }
29       const releaseName = this.cephReleaseNamePipe.transform(summary.version);
30       this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/`;
31       subs.unsubscribe();
32     });
33   }
34
35   openAboutModal() {
36     this.modalRef = this.modalService.show(AboutComponent);
37   }
38 }