mirror of https://github.com/rancher/ui.git
commit
ecf852e21e
|
|
@ -12,14 +12,17 @@ export default Component.extend(StorageClassProvisioner, {
|
||||||
layout,
|
layout,
|
||||||
volumeTypes: VOLUME_TYPES,
|
volumeTypes: VOLUME_TYPES,
|
||||||
|
|
||||||
volumeType: null,
|
volumeType: null,
|
||||||
zones: null,
|
fsType: null,
|
||||||
zoneAutomatic: null,
|
replicationType: null,
|
||||||
|
zones: null,
|
||||||
|
zoneAutomatic: null,
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
const changes = {};
|
const changes = {};
|
||||||
|
|
||||||
changes['volumeType'] = get(this, 'parameters.type') || 'pd-standard';
|
changes['volumeType'] = get(this, 'parameters.type') || 'pd-standard';
|
||||||
|
changes['fsType'] = get(this, 'parameters.fsType');
|
||||||
|
|
||||||
const zone = get(this, 'parameters.zone');
|
const zone = get(this, 'parameters.zone');
|
||||||
const zones = get(this, 'parameters.zones');
|
const zones = get(this, 'parameters.zones');
|
||||||
|
|
@ -35,13 +38,24 @@ export default Component.extend(StorageClassProvisioner, {
|
||||||
changes['zones'] = '';
|
changes['zones'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changes['replicationType'] = get(this, 'parameters.replication-type') || 'none';
|
||||||
setProperties(this, changes);
|
setProperties(this, changes);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateParams() {
|
updateParams() {
|
||||||
const type = get(this, 'volumeType');
|
const type = get(this, 'volumeType');
|
||||||
|
const fsType = get(this, 'fsType');
|
||||||
|
const replicationType = get(this, 'replicationType');
|
||||||
const out = { type, };
|
const out = { type, };
|
||||||
|
|
||||||
|
if ( fsType ) {
|
||||||
|
out['fsType'] = fsType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( replicationType && replicationType !== 'none') {
|
||||||
|
out['replication-type'] = replicationType;
|
||||||
|
}
|
||||||
|
|
||||||
const zoneAutomatic = get(this, 'zoneAutomatic');
|
const zoneAutomatic = get(this, 'zoneAutomatic');
|
||||||
|
|
||||||
if ( !zoneAutomatic ) {
|
if ( !zoneAutomatic ) {
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,34 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-4">
|
<div class="col span-4">
|
||||||
<label class="acc-label">{{t 'cruStorageClass.gce-pd.type.label'}}</label>
|
<label class="acc-label">{{t "cruStorageClass.gce-pd.type.label"}}</label>
|
||||||
{{#if editing}}
|
{{#if editing}}
|
||||||
{{#each volumeTypes as |name|}}
|
{{#each volumeTypes as |name|}}
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
{{radio-button selection=volumeType value=name}}
|
{{radio-button selection=volumeType value=name}}
|
||||||
{{t (concat 'cruStorageClass.gce-pd.type.' name)}}
|
{{t (concat "cruStorageClass.gce-pd.type." name)}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
{{t (concat 'cruStorageClass.gce-pd.type.' volumeType)}}
|
{{t (concat "cruStorageClass.gce-pd.type." volumeType)}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-4">
|
<div class="col span-4">
|
||||||
<label class="acc-label">{{t 'cruStorageClass.gce-pd.zone.label'}}</label>
|
<label class="acc-label">{{t "cruStorageClass.gce-pd.zone.label"}}</label>
|
||||||
{{#if editing}}
|
{{#if editing}}
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
{{radio-button selection=zoneAutomatic value=true}}
|
{{radio-button selection=zoneAutomatic value=true}}
|
||||||
{{t 'cruStorageClass.gce-pd.zone.automatic'}}
|
{{t "cruStorageClass.gce-pd.zone.automatic"}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
{{radio-button selection=zoneAutomatic value=false}}
|
{{radio-button selection=zoneAutomatic value=false}}
|
||||||
{{t 'cruStorageClass.gce-pd.zone.manual'}}
|
{{t "cruStorageClass.gce-pd.zone.manual"}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{#unless zoneAutomatic}}
|
{{#unless zoneAutomatic}}
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
{{#if zoneAutomatic}}
|
{{#if zoneAutomatic}}
|
||||||
{{t 'cruStorageClass.gce-pd.zone.automatic'}}
|
{{t "cruStorageClass.gce-pd.zone.automatic"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{zones}}
|
{{zones}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -45,3 +45,38 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col span-4">
|
||||||
|
<label class="acc-label">
|
||||||
|
{{t "cruStorageClass.gce-pd.fsType.label"}}
|
||||||
|
</label>
|
||||||
|
{{#input-or-display editable=editing value=fsType}}
|
||||||
|
{{input
|
||||||
|
type="text"
|
||||||
|
value=fsType
|
||||||
|
classNames="form-control"
|
||||||
|
placeholder=(t "cruStorageClass.gce-pd.fsType.placeholder")
|
||||||
|
}}
|
||||||
|
{{/input-or-display}}
|
||||||
|
</div>
|
||||||
|
<div class="col span-4">
|
||||||
|
<label class="acc-label">
|
||||||
|
{{t "cruStorageClass.gce-pd.replicationType.label"}}
|
||||||
|
</label>
|
||||||
|
{{#input-or-display editable=editing value=replicationType}}
|
||||||
|
<div class="radio">
|
||||||
|
<label>
|
||||||
|
{{radio-button selection=replicationType value="none"}}
|
||||||
|
{{t "cruStorageClass.gce-pd.replicationType.none"}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<label>
|
||||||
|
{{radio-button selection=replicationType value="regional-pd"}}
|
||||||
|
{{t "cruStorageClass.gce-pd.replicationType.regionalPd"}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{{/input-or-display}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4066,6 +4066,13 @@ cruStorageClass:
|
||||||
label: Volume Type
|
label: Volume Type
|
||||||
pd-standard: 'Standard'
|
pd-standard: 'Standard'
|
||||||
pd-ssd: 'SSD'
|
pd-ssd: 'SSD'
|
||||||
|
fsType:
|
||||||
|
label: Filesystem Type
|
||||||
|
placeholder: "e.g. ext4"
|
||||||
|
replicationType:
|
||||||
|
label: Replication Type
|
||||||
|
none: Zonal
|
||||||
|
regionalPd: Regional
|
||||||
zone:
|
zone:
|
||||||
label: Availability Zone
|
label: Availability Zone
|
||||||
automatic: "Automatic: Zones the cluster has a node in"
|
automatic: "Automatic: Zones the cluster has a node in"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue