mirror of
https://github.com/ceph/ceph
synced 2025-03-29 23:09:47 +00:00
mgr/dashboard: fix unmanged iscsi service creation
Signed-off-by: Nizamudeen A <nia@redhat.com>
This commit is contained in:
parent
ea68560e14
commit
7d157fe48e
@ -212,35 +212,37 @@
|
||||
</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"
|
||||
|
@ -147,8 +147,7 @@ export class ServiceFormComponent extends CdForm implements OnInit {
|
||||
null,
|
||||
[
|
||||
CdValidators.requiredIf({
|
||||
service_type: 'iscsi',
|
||||
unmanaged: false
|
||||
service_type: 'iscsi'
|
||||
})
|
||||
]
|
||||
],
|
||||
@ -575,6 +574,10 @@ export class ServiceFormComponent extends CdForm implements OnInit {
|
||||
serviceSpec['monitor_port'] = values['monitor_port'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'iscsi':
|
||||
serviceSpec['pool'] = values['pool'];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!values['unmanaged']) {
|
||||
@ -602,7 +605,6 @@ export class ServiceFormComponent extends CdForm implements OnInit {
|
||||
}
|
||||
break;
|
||||
case 'iscsi':
|
||||
serviceSpec['pool'] = values['pool'];
|
||||
if (_.isString(values['trusted_ip_list']) && !_.isEmpty(values['trusted_ip_list'])) {
|
||||
serviceSpec['trusted_ip_list'] = values['trusted_ip_list'].trim();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user