]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
843b000b2fa12fbdcf19b716d27a61cb2451c089
[ceph.git] /
1 import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
2 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
4 @Component({
5   selector: 'cd-cephfs-mount-details',
6   templateUrl: './cephfs-mount-details.component.html',
7   styleUrls: ['./cephfs-mount-details.component.scss']
8 })
9 export class CephfsMountDetailsComponent implements OnInit, OnDestroy {
10   @ViewChild('mountDetailsTpl', { static: true })
11   mountDetailsTpl: any;
12   onCancel?: Function;
13   private canceled = false;
14   private MOUNT_DIRECTORY = '<MOUNT_DIRECTORY>';
15   mountData!: Record<string, any>;
16   constructor(public activeModal: NgbActiveModal) {}
17   mount!: string;
18   fuse!: string;
19   nfs!: string;
20
21   ngOnInit(): void {
22     this.mount = `sudo mount -t ceph <CLIENT_USER>@${this.mountData?.fsId}.${this.mountData?.fsName}=${this.mountData?.rootPath} ${this.MOUNT_DIRECTORY}`;
23     this.fuse = `sudo ceph-fuse  ${this.MOUNT_DIRECTORY} -r ${this.mountData?.rootPath} --client_mds_namespace=${this.mountData?.fsName}`;
24     this.nfs = `sudo mount -t nfs -o port=<PORT> <IP of active_nfs daemon>:<export_name> ${this.MOUNT_DIRECTORY}`;
25   }
26
27   ngOnDestroy(): void {
28     if (this.onCancel && this.canceled) {
29       this.onCancel();
30     }
31   }
32
33   cancel() {
34     this.canceled = true;
35     this.activeModal.close();
36   }
37 }