File

src/app/ceph/nfs/nfs-501/nfs-501.component.ts

Implements

OnInit OnDestroy

Metadata

selector cd-nfs-501
styleUrls ./nfs-501.component.scss
templateUrl ./nfs-501.component.html

Index

Properties
Methods

Constructor

constructor(route: ActivatedRoute, summaryService: SummaryService, cephReleaseNamePipe: CephReleaseNamePipe, i18n: I18n)
Parameters :
Name Type Optional
route ActivatedRoute No
summaryService SummaryService No
cephReleaseNamePipe CephReleaseNamePipe No
i18n I18n No

Methods

ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

docsUrl
Type : string
message
Default value : this.i18n('The NFS Ganesha service is not configured.')
routeParamsSubscribe
Type : any
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

import { I18n } from '@ngx-translate/i18n-polyfill';

import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
import { SummaryService } from '../../../shared/services/summary.service';

@Component({
  selector: 'cd-nfs-501',
  templateUrl: './nfs-501.component.html',
  styleUrls: ['./nfs-501.component.scss']
})
export class Nfs501Component implements OnInit, OnDestroy {
  docsUrl: string;
  message = this.i18n('The NFS Ganesha service is not configured.');
  routeParamsSubscribe: any;

  constructor(
    private route: ActivatedRoute,
    private summaryService: SummaryService,
    private cephReleaseNamePipe: CephReleaseNamePipe,
    private i18n: I18n
  ) {}

  ngOnInit() {
    const subs = this.summaryService.subscribe((summary: any) => {
      if (!summary) {
        return;
      }

      const releaseName = this.cephReleaseNamePipe.transform(summary.version);
      this.docsUrl =
        `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/` +
        `#configuring-nfs-ganesha-in-the-dashboard`;

      setTimeout(() => {
        subs.unsubscribe();
      }, 0);
    });

    this.routeParamsSubscribe = this.route.params.subscribe((params: { message: string }) => {
      this.message = params.message;
    });
  }

  ngOnDestroy() {
    this.routeParamsSubscribe.unsubscribe();
  }
}
<cd-info-panel>
  {{ message }}<br>
  <ng-container i18n>Please consult the <a href="{{docsUrl}}" target="_blank">documentation</a>
  on how to configure and enable the NFS Ganesha management functionality.</ng-container>
</cd-info-panel>

./nfs-501.component.scss

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""