1 import { Component, Input, OnChanges } from '@angular/core';
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4 import * as _ from 'lodash';
6 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
9 selector: 'cd-nfs-details',
10 templateUrl: './nfs-details.component.html',
11 styleUrls: ['./nfs-details.component.scss']
13 export class NfsDetailsComponent implements OnChanges {
15 selection: CdTableSelection;
20 constructor(private i18n: I18n) {}
23 if (this.selection.hasSelection) {
24 this.selectedItem = this.selection.first();
26 this.data[this.i18n('Cluster')] = this.selectedItem.cluster_id;
27 this.data[this.i18n('Daemons')] = this.selectedItem.daemons;
28 this.data[this.i18n('NFS Protocol')] = this.selectedItem.protocols.map(
29 (protocol) => 'NFSv' + protocol
31 this.data[this.i18n('Pseudo')] = this.selectedItem.pseudo;
32 this.data[this.i18n('Access Type')] = this.selectedItem.access_type;
33 this.data[this.i18n('Squash')] = this.selectedItem.squash;
34 this.data[this.i18n('Transport')] = this.selectedItem.transports;
35 this.data[this.i18n('Path')] = this.selectedItem.path;
37 if (this.selectedItem.fsal.name === 'CEPH') {
38 this.data[this.i18n('Storage Backend')] = this.i18n('CephFS');
39 this.data[this.i18n('CephFS User')] = this.selectedItem.fsal.user_id;
40 this.data[this.i18n('CephFS Filesystem')] = this.selectedItem.fsal.fs_name;
41 this.data[this.i18n('Security Label')] = this.selectedItem.fsal.sec_label_xattr;
43 this.data[this.i18n('Storage Backend')] = this.i18n('Object Gateway');
44 this.data[this.i18n('Object Gateway User')] = this.selectedItem.fsal.rgw_user_id;