1 import { Component, OnInit, ViewChild } from '@angular/core';
3 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5 import { Icons } from '../../../shared/enum/icons.enum';
6 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
7 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
8 import { ModalService } from '../../../shared/services/modal.service';
9 import { SummaryService } from '../../../shared/services/summary.service';
10 import { AboutComponent } from '../about/about.component';
13 selector: 'cd-dashboard-help',
14 templateUrl: './dashboard-help.component.html',
15 styleUrls: ['./dashboard-help.component.scss']
17 export class DashboardHelpComponent implements OnInit {
18 @ViewChild('docsForm', { static: true })
21 modalRef: NgbModalRef;
25 private summaryService: SummaryService,
26 private cephReleaseNamePipe: CephReleaseNamePipe,
27 private modalService: ModalService,
28 private authStorageService: AuthStorageService
32 this.summaryService.subscribeOnce((summary) => {
33 const releaseName = this.cephReleaseNamePipe.transform(summary.version);
34 this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/`;
39 this.modalRef = this.modalService.show(AboutComponent, null, { size: 'lg' });
43 const tokenInput = this.docsFormElement.nativeElement.children[0];
44 tokenInput.value = this.authStorageService.getToken();
45 this.docsFormElement.nativeElement.submit();