]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / nfs / nfs-form-client / nfs-form-client.component.ts
index a549deb0445cecc4bc3954e23c86dd8c01160e3a..0c9bc088dc50cbd9dffaaddd6155f01609bb21f9 100644 (file)
@@ -1,10 +1,11 @@
 import { Component, Input } from '@angular/core';
-import { FormArray, FormControl, Validators } from '@angular/forms';
+import { FormArray, FormControl, NgForm, Validators } from '@angular/forms';
 
 import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { NfsService } from '../../../shared/api/nfs.service';
+import { Icons } from '../../../shared/enum/icons.enum';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 
 @Component({
@@ -18,6 +19,7 @@ export class NfsFormClientComponent {
 
   nfsSquash: any[] = this.nfsService.nfsSquash;
   nfsAccessType: any[] = this.nfsService.nfsAccessType;
+  icons = Icons;
 
   constructor(private nfsService: NfsService, private i18n: I18n) {}
 
@@ -28,7 +30,7 @@ export class NfsFormClientComponent {
     return this.i18n('-- Select the access type --');
   }
 
-  getAccessTypeHelp(index) {
+  getAccessTypeHelp(index: number) {
     const accessTypeItem = this.nfsAccessType.find((currentAccessTypeItem) => {
       return this.getValue(index, 'access_type') === currentAccessTypeItem.value;
     });
@@ -60,16 +62,16 @@ export class NfsFormClientComponent {
     return fg;
   }
 
-  removeClient(index) {
+  removeClient(index: number) {
     const clients = this.form.get('clients') as FormArray;
     clients.removeAt(index);
   }
 
-  showError(index, control, formDir, x) {
+  showError(index: number, control: string, formDir: NgForm, x: string) {
     return (<any>this.form.controls.clients).controls[index].showError(control, formDir, x);
   }
 
-  getValue(index, control) {
+  getValue(index: number, control: string) {
     const clients = this.form.get('clients') as FormArray;
     const client = clients.at(index) as CdFormGroup;
     return client.getValue(control);
@@ -82,7 +84,7 @@ export class NfsFormClientComponent {
     });
   }
 
-  trackByFn(index) {
+  trackByFn(index: number) {
     return index;
   }
 }