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