]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / nfs / nfs-501 / nfs-501.component.ts
1 import { Component, OnDestroy, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3
4 import { I18n } from '@ngx-translate/i18n-polyfill';
5
6 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
7 import { SummaryService } from '../../../shared/services/summary.service';
8
9 @Component({
10 selector: 'cd-nfs-501',
11 templateUrl: './nfs-501.component.html',
12 styleUrls: ['./nfs-501.component.scss']
13 })
14 export class Nfs501Component implements OnInit, OnDestroy {
15 docsUrl: string;
16 message = this.i18n('The NFS Ganesha service is not configured.');
17 routeParamsSubscribe: any;
18
19 constructor(
20 private route: ActivatedRoute,
21 private summaryService: SummaryService,
22 private cephReleaseNamePipe: CephReleaseNamePipe,
23 private i18n: I18n
24 ) {}
25
26 ngOnInit() {
27 const subs = this.summaryService.subscribe((summary: any) => {
28 if (!summary) {
29 return;
30 }
31
32 const releaseName = this.cephReleaseNamePipe.transform(summary.version);
33 this.docsUrl =
34 `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/` +
35 `#configuring-nfs-ganesha-in-the-dashboard`;
36
37 setTimeout(() => {
38 subs.unsubscribe();
39 }, 0);
40 });
41
42 this.routeParamsSubscribe = this.route.params.subscribe((params: { message: string }) => {
43 this.message = params.message;
44 });
45 }
46
47 ngOnDestroy() {
48 this.routeParamsSubscribe.unsubscribe();
49 }
50 }