]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
a76275bbec98c1499fa68b978b89b32979fe1fa3
[ceph.git] /
1 import { Component, OnInit, ViewChild } from '@angular/core';
2
3 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
4
5 import { Icons } from '~/app/shared/enum/icons.enum';
6 import { DocService } from '~/app/shared/services/doc.service';
7 import { ModalService } from '~/app/shared/services/modal.service';
8 import { AboutComponent } from '../about/about.component';
9
10 @Component({
11   selector: 'cd-dashboard-help',
12   templateUrl: './dashboard-help.component.html',
13   styleUrls: ['./dashboard-help.component.scss']
14 })
15 export class DashboardHelpComponent implements OnInit {
16   @ViewChild('docsForm', { static: true })
17   docsFormElement: any;
18   docsUrl: string;
19   modalRef: NgbModalRef;
20   icons = Icons;
21
22   constructor(private modalService: ModalService, private docService: DocService) {}
23
24   ngOnInit() {
25     this.docService.subscribeOnce('dashboard', (url: string) => {
26       this.docsUrl = url;
27     });
28   }
29
30   openAboutModal() {
31     this.modalRef = this.modalService.show(AboutComponent, null, { size: 'lg' });
32   }
33
34   goToApiDocs() {
35     this.docsFormElement.nativeElement.submit();
36   }
37 }