]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.ts
import 15.2.4
[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
5 import { CdTableColumn } from '../../../shared/models/cd-table-column';
6
7 @Component({
8 selector: 'cd-nfs-details',
9 templateUrl: './nfs-details.component.html',
10 styleUrls: ['./nfs-details.component.scss']
11 })
12 export class NfsDetailsComponent implements OnChanges {
13 @Input()
14 selection: any;
15
16 selectedItem: any;
17 data: any;
18
19 clientsColumns: CdTableColumn[];
20 clients: any[] = [];
21
22 constructor(private i18n: I18n) {
23 this.clientsColumns = [
24 {
25 name: this.i18n('Addresses'),
26 prop: 'addresses',
27 flexGrow: 2
28 },
29 {
30 name: this.i18n('Access Type'),
31 prop: 'access_type',
32 flexGrow: 1
33 },
34 {
35 name: this.i18n('Squash'),
36 prop: 'squash',
37 flexGrow: 1
38 }
39 ];
40 }
41
42 ngOnChanges() {
43 if (this.selection) {
44 this.selectedItem = this.selection;
45
46 this.clients = this.selectedItem.clients;
47
48 this.data = {};
49 this.data[this.i18n('Cluster')] = this.selectedItem.cluster_id;
50 this.data[this.i18n('Daemons')] = this.selectedItem.daemons;
51 this.data[this.i18n('NFS Protocol')] = this.selectedItem.protocols.map(
52 (protocol: string) => 'NFSv' + protocol
53 );
54 this.data[this.i18n('Pseudo')] = this.selectedItem.pseudo;
55 this.data[this.i18n('Access Type')] = this.selectedItem.access_type;
56 this.data[this.i18n('Squash')] = this.selectedItem.squash;
57 this.data[this.i18n('Transport')] = this.selectedItem.transports;
58 this.data[this.i18n('Path')] = this.selectedItem.path;
59
60 if (this.selectedItem.fsal.name === 'CEPH') {
61 this.data[this.i18n('Storage Backend')] = this.i18n('CephFS');
62 this.data[this.i18n('CephFS User')] = this.selectedItem.fsal.user_id;
63 this.data[this.i18n('CephFS Filesystem')] = this.selectedItem.fsal.fs_name;
64 this.data[this.i18n('Security Label')] = this.selectedItem.fsal.sec_label_xattr;
65 } else {
66 this.data[this.i18n('Storage Backend')] = this.i18n('Object Gateway');
67 this.data[this.i18n('Object Gateway User')] = this.selectedItem.fsal.rgw_user_id;
68 }
69 }
70 }
71 }