1 import { Component, OnInit, ViewChild } from '@angular/core';
3 import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
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 { SummaryService } from '../../../shared/services/summary.service';
9 import { AboutComponent } from '../about/about.component';
12 selector: 'cd-dashboard-help',
13 templateUrl: './dashboard-help.component.html',
14 styleUrls: ['./dashboard-help.component.scss']
16 export class DashboardHelpComponent implements OnInit {
17 @ViewChild('docsForm', { static: true })
24 private summaryService: SummaryService,
25 private cephReleaseNamePipe: CephReleaseNamePipe,
26 private modalService: BsModalService,
27 private authStorageService: AuthStorageService
31 const subs = this.summaryService.subscribe((summary: any) => {
36 const releaseName = this.cephReleaseNamePipe.transform(summary.version);
37 this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/`;
46 this.modalRef = this.modalService.show(AboutComponent);
47 this.modalRef.setClass('modal-lg');
51 const tokenInput = this.docsFormElement.nativeElement.children[0];
52 tokenInput.value = this.authStorageService.getToken();
53 this.docsFormElement.nativeElement.submit();