<span class="required"></span>
</label>
<div class="col-sm-9">
+ <input class="form-control"
+ type="text"
+ id="pool"
+ name="pool"
+ formControlName="pool"
+ *ngIf="mode === 'editing'">
<select id="pool"
name="pool"
class="form-control"
- formControlName="pool">
+ formControlName="pool"
+ *ngIf="mode !== 'editing'">
<option *ngIf="pools === null"
[ngValue]="null">Loading...
</option>
</cd-helper>
</label>
<div class="col-sm-9">
+ <input class="form-control"
+ type="text"
+ id="dataPool"
+ name="dataPool"
+ formControlName="dataPool"
+ *ngIf="mode === 'editing'">
<select id="dataPool"
name="dataPool"
class="form-control"
formControlName="dataPool"
- (change)="onDataPoolChange($event.target.value)">
+ (change)="onDataPoolChange($event.target.value)"
+ *ngIf="mode !== 'editing'">
<option *ngIf="dataPools === null"
[ngValue]="null">Loading...
</option>
this.setFeatures(defaultFeatures);
});
}
- this.poolService.list(['pool_name', 'type', 'flags_names', 'application_metadata']).then(
- resp => {
- const pools = [];
- const dataPools = [];
- for (const pool of resp) {
- if (_.indexOf(pool.application_metadata, 'rbd') !== -1) {
- if (pool.type === 'replicated') {
- pools.push(pool);
- dataPools.push(pool);
- } else if (pool.type === 'erasure' &&
- pool.flags_names.indexOf('ec_overwrites') !== -1) {
- dataPools.push(pool);
+ if (this.mode !== this.rbdFormMode.editing) {
+ this.poolService.list(['pool_name', 'type', 'flags_names', 'application_metadata']).then(
+ resp => {
+ const pools = [];
+ const dataPools = [];
+ for (const pool of resp) {
+ if (_.indexOf(pool.application_metadata, 'rbd') !== -1) {
+ if (pool.type === 'replicated') {
+ pools.push(pool);
+ dataPools.push(pool);
+ } else if (pool.type === 'erasure' &&
+ pool.flags_names.indexOf('ec_overwrites') !== -1) {
+ dataPools.push(pool);
+ }
}
}
+ this.pools = pools;
+ this.allPools = pools;
+ this.dataPools = dataPools;
+ this.allDataPools = dataPools;
+ if (this.pools.length === 1) {
+ const poolName = this.pools[0]['pool_name'];
+ this.rbdForm.get('pool').setValue(poolName);
+ this.onPoolChange(poolName);
+ }
}
- this.pools = pools;
- this.allPools = pools;
- this.dataPools = dataPools;
- this.allDataPools = dataPools;
- if (this.pools.length === 1) {
- const poolName = this.pools[0]['pool_name'];
- this.rbdForm.get('pool').setValue(poolName);
- this.onPoolChange(poolName);
- }
- }
- );
+ );
+ }
this.deepFlattenFormControl.valueChanges.subscribe((value) => {
this.watchDataFeatures('deep-flatten', value);
});