Skip to content

Commit

Permalink
mgr/dashboard: Fix NFS clients squash/access_type default values
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/40012

Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit d038663)
  • Loading branch information
Tiago Melo committed May 30, 2019
1 parent 50f8b3a commit 1d5e950
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Expand Up @@ -60,7 +60,7 @@ <h3 class="panel-title">{{ (index + 1) | ordinal }}
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>
Expand All @@ -81,7 +81,7 @@ <h3 class="panel-title">{{ (index + 1) | ordinal }}
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>
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -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') {
Expand Down

0 comments on commit 1d5e950

Please sign in to comment.