mirror of https://github.com/rancher/ui.git
Engine install URL options (rancher/rancher#5170)
This commit is contained in:
parent
9bc925e005
commit
bcdaa7b8c4
|
|
@ -4,6 +4,7 @@ import C from 'ui/utils/constants';
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
machine: null,
|
machine: null,
|
||||||
settings: Ember.inject.service(),
|
settings: Ember.inject.service(),
|
||||||
|
intl: Ember.inject.service(),
|
||||||
showEngineUrl: null,
|
showEngineUrl: null,
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
|
|
@ -12,4 +13,22 @@ export default Ember.Component.extend({
|
||||||
this.set('machine.engineInstallUrl', this.get(`settings.${C.SETTING.ENGINE_URL}`) || '');
|
this.set('machine.engineInstallUrl', this.get(`settings.${C.SETTING.ENGINE_URL}`) || '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
engineUrlChoices: function() {
|
||||||
|
let def = this.get(`settings.${C.SETTING.ENGINE_URL}`);
|
||||||
|
let out = [
|
||||||
|
{label: this.get('intl').t('formEngineOpts.engineInstallUrl.recommended'), value: def},
|
||||||
|
{label: 'v1.10.x', value: 'https://releases.rancher.com/install-docker/1.10.sh'},
|
||||||
|
{label: 'v1.11.x', value: 'https://releases.rancher.com/install-docker/1.11.sh'},
|
||||||
|
{label: this.get('intl').t('formEngineOpts.engineInstallUrl.latest'), value: 'https://get.docker.com'},
|
||||||
|
];
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}.property('intl._locale',`settings.${C.SETTING.ENGINE_URL}`),
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
setEngine(url) {
|
||||||
|
this.set('machine.engineInstallUrl', url);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,17 @@
|
||||||
<label class="form-control-static">{{t 'formEngineOpts.engineInstallUrl.label'}}</label>
|
<label class="form-control-static">{{t 'formEngineOpts.engineInstallUrl.label'}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
{{input type="text" value=machine.engineInstallUrl classNames="form-control" placeholder=(t 'formEngineOpts.engineInstallUrl.placeholder')}}
|
<div class="input-group">
|
||||||
|
{{input type="text" value=machine.engineInstallUrl classNames="form-control" placeholder=(t 'formEngineOpts.engineInstallUrl.placeholder')}}
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="icon icon-chevron-down"></i></button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right" role="menu" style="min-width: 250px; max-height: 300px; overflow-y: auto;">
|
||||||
|
{{#each engineUrlChoices as |choice|}}
|
||||||
|
<li><a href="#" {{action "setEngine" choice.value}}>{{choice.label}}</a></li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -1586,6 +1586,8 @@ formEngineOpts:
|
||||||
engineInstallUrl:
|
engineInstallUrl:
|
||||||
label: Docker Install URL
|
label: Docker Install URL
|
||||||
placeholder: e.g. http://get.docker.com/
|
placeholder: e.g. http://get.docker.com/
|
||||||
|
recommended: Recommended
|
||||||
|
latest: Latest
|
||||||
engineStorageDriver:
|
engineStorageDriver:
|
||||||
label: Storage Driver
|
label: Storage Driver
|
||||||
placeholder: e.g. overlay
|
placeholder: e.g. overlay
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue