<!-- Domain Settings -->
<div class="form-item"
- *ngIf="this.smbForm.get('auth_mode').value === 'active-directory'">
+ *ngIf="this.smbForm.get('auth_mode').value === AUTHMODE.ActiveDirectory">
<div cdsCol
[columnNumbers]="{ md: 12 }"
class="d-flex">
*ngFor="let _ of joinSources.controls; index as i">
<div
cdsRow
- *ngIf="this.smbForm.get('auth_mode').value === 'user' && usersGroups$ | async as usersGroups"
+ *ngIf="this.smbForm.get('auth_mode').value === AUTHMODE.User && usersGroups$ | async as usersGroups"
class="form-item form-item-append"
>
<div
</ng-container>
<div class="form-item"
- *ngIf="this.smbForm.get('auth_mode').value === 'user'">
+ *ngIf="this.smbForm.get('auth_mode').value === AUTHMODE.User">
<button cdsButton="tertiary"
type="button"
(click)="addUserGroupSetting()"
<div class="form-item">
<cds-select
label="Placement"
- for="placement"
formControlName="placement"
id="placement"
>
</div>
<!-- Custom DNS -->
- <ng-container formArrayName="custom_dns"
- *ngFor="let _ of custom_dns.controls; index as i">
- <div cdsRow
- class="form-item form-item-append">
- <div cdsCol
- [columnNumbers]="{ lg: 14 }">
- <cds-text-label
- for="custom_dns"
- i18n
- >DNS
- <input cdsText
- [formControlName]="i"
- placeholder="192.168.76.204"/>
- </cds-text-label>
- </div>
- <div
- cdsCol
- [columnNumbers]="{ lg: 1 }"
- class="item-action-btn spacing"
- >
- <cds-icon-button
- kind="danger"
- size="sm"
- (click)="removeCustomDNS(i)"
+ @if (this.smbForm.get('auth_mode').value === AUTHMODE.ActiveDirectory) {
+ <ng-container formArrayName="custom_dns"
+ *ngFor="let _ of custom_dns.controls; index as i">
+ <div cdsRow
+ class="form-item form-item-append">
+ <div cdsCol
+ [columnNumbers]="{ lg: 14 }">
+ <cds-text-label
+ for="custom_dns"
+ i18n
+ >DNS
+ <input cdsText
+ [formControlName]="i"
+ placeholder="192.168.76.204"/>
+ </cds-text-label>
+ </div>
+ <div
+ cdsCol
+ [columnNumbers]="{ lg: 1 }"
+ class="item-action-btn spacing"
>
- <svg
- cdsIcon="trash-can"
- size="32"
- class="cds--btn__icon"
+ <cds-icon-button
+ kind="danger"
+ size="sm"
+ (click)="removeCustomDNS(i)"
>
- </svg>
- </cds-icon-button>
+ <svg
+ cdsIcon="trash-can"
+ size="32"
+ class="cds--btn__icon"
+ >
+ </svg>
+ </cds-icon-button>
+ </div>
</div>
- </div>
- </ng-container>
+ </ng-container>
- <div class="form-item">
- <button cdsButton="tertiary"
- type="button"
- (click)="addCustomDns()"
- i18n>
- Add custom DNS
- <svg
- cdsIcon="add"
- size="32"
- class="cds--btn__icon"
- icon></svg>
- </button>
- <cd-helper i18n>One or more IP Addresses that will be
- applied to the Samba containers to override
- the default DNS resolver(s). This option is
- intended to be used when the host Ceph node
- is not configured to resolve DNS entries within
- AD domain(s).
- </cd-helper>
- </div>
+ <div class="form-item">
+ <button cdsButton="tertiary"
+ type="button"
+ (click)="addCustomDns()"
+ i18n>
+ Add custom DNS
+ <svg
+ cdsIcon="add"
+ size="32"
+ class="cds--btn__icon"
+ icon></svg>
+ </button>
+ <cd-helper i18n>One or more IP Addresses that will be
+ applied to the Samba containers to override
+ the default DNS resolver(s). This option is
+ intended to be used when the host Ceph node
+ is not configured to resolve DNS entries within
+ AD domain(s).
+ </cd-helper>
+ </div>
+ }
<!-- Clustering -->
<div class="form-item">
</cds-select>
</div>
+ <div
+ *ngIf="(this.smbForm.get('count').value > 1 && this.smbForm.get('clustering').value.toLowerCase() == CLUSTERING.Default) || this.smbForm.get('clustering').value.toLowerCase() == CLUSTERING.Always"
+ class="form-item"
+ >
+
<!-- Public addrs -->
<ng-container formArrayName="public_addrs"
*ngFor="let _ of public_addrs.controls; index as i">
<div cdsCol
[columnNumbers]="{ lg: 7 }">
<cds-text-label
- for="public_addrs"
+ for="address"
i18n
helperText="This address will be assigned to one of the host's network devices and managed automatically."
i18n-helperText
cdrequiredField
- [invalid]="smbForm?.controls['public_addrs']?.controls[i].controls.address.invalid && smbForm?.controls['public_addrs']?.controls[i].controls.address.dirty"
+ [invalid]="smbForm?.controls['public_addrs']?.controls[i]?.controls?.address?.invalid && smbForm?.controls['public_addrs']?.controls[i]?.controls?.address?.dirty"
[invalidText]="addressError"
>Address
<input
type="text"
formControlName="address"
placeholder="192.168.4.51/24"
- [invalid]="smbForm?.controls['public_addrs'].controls[i].controls.address.invalid && smbForm?.controls['public_addrs']?.controls[i].controls.address.dirty"
+ [invalid]="smbForm?.controls['public_addrs'].controls[i].controls?.address?.invalid && smbForm?.controls['public_addrs']?.controls[i]?.controls?.address?.dirty"
/>
</cds-text-label>
<ng-template #addressError>
<div cdsCol
[columnNumbers]="{ lg: 7 }">
<cds-text-label
- for="public_addrs"
+ for="destination"
i18n
helperText="Defines where the system will assign the managed IPs. Each string value must be a network address."
i18n-helperText
</div>
</ng-container>
</ng-container>
- <div
- *ngIf="(this.smbForm.get('count').value > 1 && this.smbForm.get('clustering').value.toLowerCase() == CLUSTERING.Default) || this.smbForm.get('clustering').value.toLowerCase() == CLUSTERING.Always"
- class="form-item"
- >
<button cdsButton="tertiary"
type="button"
(click)="addPublicAddrs()"
orchStatus$: Observable<any>;
allClustering: string[] = [];
CLUSTERING = CLUSTERING;
+ AUTHMODE = AUTHMODE;
selectedLabels: string[] = [];
selectedHosts: string[] = [];
action: string;
customDnsFormArray.push(new FormControl(dns));
});
}
- if (this.clusterResponse.auth_mode == AUTHMODE.activeDirectory) {
+ if (this.clusterResponse.auth_mode == AUTHMODE.ActiveDirectory) {
this.domainSettingsObject = this.clusterResponse?.domain_settings;
this.smbForm.get('domain_settings').setValue(this.domainSettingsObject.realm);
} else {
validators: [Validators.required]
}),
auth_mode: [
- AUTHMODE.activeDirectory,
+ AUTHMODE.ActiveDirectory,
{
validators: [Validators.required]
}
],
domain_settings: [null],
- placement: [{}],
+ placement: [],
hosts: [[]],
label: [
null,
const userGroupSettingsControl = this.smbForm.get('joinSources') as FormArray;
// User Group Setting should be optional if authMode is "Active Directory"
- if (authMode === AUTHMODE.activeDirectory) {
+ if (authMode === AUTHMODE.ActiveDirectory) {
if (userGroupSettingsControl) {
userGroupSettingsControl.clear();
}
}
// Domain Setting should be mandatory if authMode is "Active Directory"
- if (authMode === AUTHMODE.activeDirectory && !domainSettingsControl.value) {
+ if (authMode === AUTHMODE.ActiveDirectory && !domainSettingsControl.value) {
domainSettingsControl.setErrors({ required: true });
this.smbForm.markAllAsTouched();
return;
requestModel.cluster_resource.clustering = rawFormValue.clustering.toLowerCase();
}
- if (rawFormValue.placement.count) {
+ if (rawFormValue.placement?.count) {
requestModel.cluster_resource.count = rawFormValue.placement.count;
}
addPublicAddrs() {
const control = this.formBuilder.group({
- address: ['', Validators.required],
- destination: ['']
+ address: new FormControl('', { validators: [Validators.required] }),
+ destination: new FormControl('')
});
this.public_addrs.push(control);
}