]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix NFS clients squash/access_type default values 28311/head
authorTiago Melo <tmelo@suse.com>
Fri, 24 May 2019 00:31:45 +0000 (00:31 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 30 May 2019 11:56:57 +0000 (11:56 +0000)
Fixes: https://tracker.ceph.com/issues/40012
Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit d038663518dad66c8edbff02ef8a1a9ef37f3fe5)

src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts

index fa75da44af4e9fbbcd41f0532b46d29b09815645..b5a05c75f1c80da27dcf0bbee6256ec465d565e8 100644 (file)
@@ -60,7 +60,7 @@
                         name="access_type"
                         id="access_type"
                         formControlName="access_type">
-                  <option [value]="form.getValue('access_type')">{{ getNoAccessTypeDescr() }}</option>
+                  <option value="">{{ getNoAccessTypeDescr() }}</option>
                   <option *ngFor="let item of nfsAccessType"
                           [value]="item.value">{{ item.value }}</option>
                 </select>
@@ -81,7 +81,7 @@
                         name="squash"
                         id="squash"
                         formControlName="squash">
-                  <option [value]="form.getValue('squash')">{{ getNoSquashDescr() }}</option>
+                  <option value="">{{ getNoSquashDescr() }}</option>
                   <option *ngFor="let squash of nfsSquash"
                           [value]="squash">{{ squash }}</option>
                 </select>
index 986dd5a4f6d2327c2593aed34b7a50fdbc04db55..a549deb0445cecc4bc3954e23c86dd8c01160e3a 100644 (file)
@@ -52,8 +52,8 @@ export class NfsFormClientComponent {
       addresses: new FormControl('', {
         validators: [Validators.required, Validators.pattern(REGEX_LIST_IP)]
       }),
-      access_type: new FormControl(this.form.getValue('access_type')),
-      squash: new FormControl(this.form.getValue('squash'))
+      access_type: new FormControl(''),
+      squash: new FormControl('')
     });
 
     clients.push(fg);
index 124214f313159630911ada1212cdd3147013df13..e234209638a099928edf60a9f0d9e4c332fbe50f 100644 (file)
@@ -542,6 +542,14 @@ export class NfsFormComponent implements OnInit {
       } else {
         client.addresses = [];
       }
+
+      if (!client.squash) {
+        client.squash = requestModel.squash;
+      }
+
+      if (!client.access_type) {
+        client.access_type = requestModel.access_type;
+      }
     });
 
     if (requestModel.security_label === false || requestModel.fsal.name === 'RGW') {