<select id="service_type"
name="service_type"
class="form-control"
- formControlName="service_type">
+ formControlName="service_type"
+ (change)="getServiceIds($event.target.value)">
<option i18n
[ngValue]="null">-- Select a service type --</option>
<option *ngFor="let serviceType of serviceTypes"
i18n>-- No service available --</option>
<option *ngIf="services !== null && services.length > 0"
[ngValue]="null"
- i18n>-- Select an existing RGW service --</option>
+ i18n>-- Select an existing service --</option>
<option *ngFor="let service of services"
[value]="service.service_name">{{ service.service_name }}</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_id', frm, 'required')"
i18n>This field is required.</span>
+ <span class="invalid-feedback"
+ *ngIf="serviceForm.showError('service_id', frm, 'uniqueName')"
+ i18n>This service id is already in use.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')"
i18n>The value does not match the pattern <strong><service_id>[.<realm_name>.<zone_name>]</strong>.</span>
</div>
<!-- unmanaged -->
- <div class="form-group row"
- *ngIf="serviceForm.controls.service_type.value !== 'snmp-gateway'">
+ <div class="form-group row">
<div class="cd-col-form-offset">
<div class="custom-control custom-checkbox">
<input class="custom-control-input"
</ng-container>
<!-- iSCSI -->
- <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
- <!-- pool -->
- <div class="form-group row">
- <label i18n
- class="cd-col-form-label required"
- for="pool">Pool</label>
- <div class="cd-col-form-input">
- <select id="pool"
- name="pool"
- class="form-control"
- formControlName="pool">
- <option *ngIf="pools === null"
- [ngValue]="null"
- i18n>Loading...</option>
- <option *ngIf="pools && pools.length === 0"
- [ngValue]="null"
- i18n>-- No pools available --</option>
- <option *ngIf="pools && pools.length > 0"
- [ngValue]="null"
- i18n>-- Select a pool --</option>
- <option *ngFor="let pool of pools"
- [value]="pool.pool_name">{{ pool.pool_name }}</option>
- </select>
- <span class="invalid-feedback"
- *ngIf="serviceForm.showError('pool', frm, 'required')"
- i18n>This field is required.</span>
- </div>
+ <!-- pool -->
+ <div class="form-group row"
+ *ngIf="serviceForm.controls.service_type.value === 'iscsi'">
+ <label i18n
+ class="cd-col-form-label required"
+ for="pool">Pool</label>
+ <div class="cd-col-form-input">
+ <select id="pool"
+ name="pool"
+ class="form-control"
+ formControlName="pool">
+ <option *ngIf="pools === null"
+ [ngValue]="null"
+ i18n>Loading...</option>
+ <option *ngIf="pools && pools.length === 0"
+ [ngValue]="null"
+ i18n>-- No pools available --</option>
+ <option *ngIf="pools && pools.length > 0"
+ [ngValue]="null"
+ i18n>-- Select a pool --</option>
+ <option *ngFor="let pool of pools"
+ [value]="pool.pool_name">{{ pool.pool_name }}</option>
+ </select>
+ <span class="invalid-feedback"
+ *ngIf="serviceForm.showError('pool', frm, 'required')"
+ i18n>This field is required.</span>
</div>
+ </div>
+ <!-- fields in iSCSI which are hidden when unmanaged is true -->
+ <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
<!-- trusted_ip_list -->
<div class="form-group row">
<label class="cd-col-form-label"
</ng-container>
<!-- Ingress -->
- <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'ingress'">
+ <ng-container *ngIf="serviceForm.controls.service_type.value === 'ingress'">
<!-- virtual_ip -->
<div class="form-group row">
<label class="cd-col-form-label"
</div>
</div>
<!-- virtual_interface_networks -->
- <div class="form-group row">
+ <div class="form-group row"
+ *ngIf="!serviceForm.controls.unmanaged.value">
<label class="cd-col-form-label"
for="virtual_interface_networks">
<span i18n>CIDR Networks</span>
</ng-container>
<!-- SNMP-Gateway -->
- <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'snmp-gateway'">
+ <ng-container *ngIf="serviceForm.controls.service_type.value === 'snmp-gateway'">
<!-- snmp-version -->
<div class="form-group row">
<label class="cd-col-form-label required"