]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / nfs / nfs-details / nfs-details.component.ts
1 import { Component, Input, OnChanges } from '@angular/core';
2
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4 import * as _ from 'lodash';
5
6 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
7
8 @Component({
9 selector: 'cd-nfs-details',
10 templateUrl: './nfs-details.component.html',
11 styleUrls: ['./nfs-details.component.scss']
12 })
13 export class NfsDetailsComponent implements OnChanges {
14 @Input()
15 selection: CdTableSelection;
16
17 selectedItem: any;
18 data: any;
19
20 constructor(private i18n: I18n) {}
21
22 ngOnChanges() {
23 if (this.selection.hasSelection) {
24 this.selectedItem = this.selection.first();
25 this.data = {};
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
30 );
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;
36
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;
42 } else {
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;
45 }
46 }
47 }
48 }