Disable DO images that don't work

This commit is contained in:
Vincent Fiduccia 2016-07-15 15:32:26 -07:00
parent 99a5aa69d2
commit c44a1c604d
13 changed files with 120 additions and 136 deletions

View File

@ -21,6 +21,7 @@ export default Ember.Component.extend({
descriptionPlaceholder : 'formNameDescription.description.placeholder',
descriptionRequired : false,
descriptionDisabled : false,
descriptionShown : true,
init() {
this._super(...arguments);

View File

@ -8,11 +8,15 @@
</div>
<div class="col-md-6">
<div class="form-label">
<label class="form-control-static">{{t descriptionLabel}}{{if descriptionRequired '*'}}</label>
</div>
{{textarea-autogrow value=_description classNames="form-control no-resize" rows="1" placeholder=descriptionPlaceholder disabled=descriptionDisabled}}
{{#if descriptionHelp}}<p class="help-block">{{t descriptionHelp}}</p>{{/if}}
{{#if descriptionShown}}
<div class="form-label">
<label class="form-control-static">{{t descriptionLabel}}{{if descriptionRequired '*'}}</label>
</div>
{{textarea-autogrow value=_description classNames="form-control no-resize" rows="1" placeholder=descriptionPlaceholder disabled=descriptionDisabled}}
{{#if descriptionHelp}}<p class="help-block">{{t descriptionHelp}}</p>{{/if}}
{{else}}
{{yield}}
{{/if}}
</div>
</div>

View File

@ -1,7 +1,7 @@
<section class="horizontal-form">
<form>
<div class="container-fluid">
<div class="over-hr r-mt20 r-mb20">
<div class="over-hr r-mb20">
<span>{{t 'machine.driverAmazon.accessSection'}}</span>
</div>

View File

@ -1,64 +1,55 @@
<div class="container-fluid">
<div class="row form-group">
<div class="col-md-8 col-md-offset-2">
<ul class="list-circles list-circles-clear">
<li>
<i>1</i>
{{format-html-message 'machine.driverCustom.step1'}}
</li>
<li>
<i>2</i>
{{t 'machine.driverCustom.step2'}}
<ul>
<li>{{format-html-message 'machine.driverCustom.step2li'}}</li>
</ul>
</li>
<li>
<i>3</i>
{{t 'machine.driverCustom.step3'}}
<div class="r-mt10">
{{form-user-labels setLabels=(action 'setLabels')}}
</div>
</li>
<li>
<i>4</i>
{{format-html-message 'machine.driverCustom.step4' rancherImage=settings.rancherImage}}
<div class="checkbox r-mt10">
{{input type="text" value=cattleAgentIp classNames="form-control" placeholder="e.g. 172.16.0.2"}}
</div>
</li>
<li>
<i>5</i>
{{t 'machine.driverCustom.step5Copy'}} {{settings.appName}}:
{{#if registrationCommand}}
<div class="copy-pre">
<pre id="registration-command">{{registrationCommand}}</pre>
{{copy-to-clipboard clipboardText=registrationCommand}}
<section>
<div class="container-fluid">
<div class="row form-group">
<div class="col-md-8 col-md-offset-2">
<ul class="list-circles list-circles-clear">
<li>
<i>1</i>
{{format-html-message 'machine.driverCustom.step1'}}
</li>
<li>
<i>2</i>
{{t 'machine.driverCustom.step2'}}
<ul>
<li>{{format-html-message 'machine.driverCustom.step2li'}}</li>
</ul>
</li>
<li>
<i>3</i>
{{t 'machine.driverCustom.step3'}}
<div class="r-mt10">
{{form-user-labels setLabels=(action 'setLabels')}}
</div>
{{else}}
<div><i class="icon icon-spinner icon-spin"></i> {{t 'machine.driverCustom.generating'}}</div>
{{/if}}
</li>
<li>
<i>5</i>
{{t 'machine.driverCustom.step5Close.part1'}} {{#link-to "hosts"}}{{t 'machine.driverCustom.step5Close.link'}}{{/link-to}} {{t 'machine.driverCustom.step5Close.part2'}}
</li>
</ul>
</li>
<li>
<i>4</i>
{{format-html-message 'machine.driverCustom.step4' rancherImage=settings.rancherImage}}
<div class="checkbox r-mt10">
{{input type="text" value=cattleAgentIp classNames="form-control" placeholder="e.g. 172.16.0.2"}}
</div>
</li>
<li>
<i>5</i>
{{t 'machine.driverCustom.step5Copy'}} {{settings.appName}}:
{{#if registrationCommand}}
<div class="copy-pre">
<pre id="registration-command">{{registrationCommand}}</pre>
{{copy-to-clipboard clipboardText=registrationCommand}}
</div>
{{else}}
<div><i class="icon icon-spinner icon-spin"></i> {{t 'machine.driverCustom.generating'}}</div>
{{/if}}
</li>
<li>
<i>5</i>
{{t 'machine.driverCustom.step5Close.part1'}} {{#link-to "hosts"}}{{t 'machine.driverCustom.step5Close.link'}}{{/link-to}} {{t 'machine.driverCustom.step5Close.part2'}}
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="footer-actions">
<button {{action "cancel"}} class="btn btn-primary">{{t 'machine.driverCustom.close'}}</button>
</div>
<div class="footer-actions">
<button {{action "cancel"}} class="btn btn-primary">{{t 'machine.driverCustom.close'}}</button>
</div>
</section>

View File

@ -2,8 +2,22 @@ import Ember from 'ember';
import Driver from 'ui/mixins/driver';
import { ajaxPromise } from 'ember-api-store/utils/ajax-promise';
const DIGITALOCEAN_API = 'api.digitalocean.com/v2';
const VALID_IMAGES = ['centos-6-x64', 'centos-7-0-x64', 'coreos-alpha', 'coreos-beta', 'coreos-stable', 'debian-7-x64', 'debian-8-x64', 'fedora-23-x64', 'fedora-24-x64', 'freebsd-10-1-x64', 'freebsd-10-2-x64', 'ubuntu-14-04-x64', 'ubuntu-16-04-x64'];
const DIGITALOCEAN_API = 'api.digitalocean.com/v2';
const VALID_IMAGES = [
// 'centos-6-x64',
// 'centos-7-0-x64',
// 'coreos-alpha',
// 'coreos-beta',
// 'coreos-stable',
// 'debian-7-x64',
// 'debian-8-x64',
// 'fedora-23-x64',
// 'fedora-24-x64',
// 'freebsd-10-1-x64',
// 'freebsd-10-2-x64',
'ubuntu-14-04-x64',
// 'ubuntu-16-04-x64'
];
export default Ember.Component.extend(Driver, {
driverName: 'digitalocean',
@ -46,8 +60,11 @@ export default Ember.Component.extend(Driver, {
});
let filteredImages = hash.images.images.filter(function(image) {
return VALID_IMAGES.indexOf(image.slug) >= 0;
}).sortBy('distribution');
return !((image.name||'').match(/x32$/));
}).map(function(image) {
image.disabled = VALID_IMAGES.indexOf(image.slug) === -1;
return image;
}).sortBy('distribution','name');
this.setProperties({
regionChoices: filteredRegions,
@ -120,7 +137,7 @@ export default Ember.Component.extend(Driver, {
apiRequest: function(command, params, method='GET') {
let proxyEndpoint = this.get('app.proxyEndpoint');
let url = `${proxyEndpoint}/${DIGITALOCEAN_API}/${command}`;
let url = `${proxyEndpoint}/${DIGITALOCEAN_API}/${command}?per_page=100`;
let accessToken = this.get('model.digitaloceanConfig.accessToken');
return ajaxPromise({

View File

@ -1,7 +1,7 @@
<section class="horizontal-form">
{{#if step1}}
<form>
<div class="over-hr r-mt20 r-mb20">
<div class="over-hr r-mb20">
<span>{{t 'machine.driverDigitalocean.accountSection'}}</span>
</div>
@ -57,7 +57,7 @@
<div class="col-md-4">
<select class="form-control" onchange={{action (mut digitaloceanConfig.image) value="target.value"}}>
{{#each imageChoices as |choice|}}
<option value={{choice.slug}} selected={{eq digitaloceanConfig.image choice.slug}}>{{choice.distribution}} {{choice.name}}</option>
<option value={{choice.slug}} disabled={{choice.disabled}} selected={{eq digitaloceanConfig.image choice.slug}}>{{choice.distribution}} {{choice.name}}</option>
{{/each}}
</select>
</div>
@ -67,7 +67,7 @@
<div class="col-md-4">
<select class="form-control" onchange={{action (mut digitaloceanConfig.size) value="target.value"}}>
{{#each filteredSizeChoices as |choice|}}
<option value={{choice.slug}} selected={{eq digitaloceanConfig.size choice.slug}}>{{choice.slug}} {{t 'machine.driverDigitalocean.imageChoices.ram'}}, {{choice.disk}}{{t 'machine.driverDigitalocean.imageChoices.gb'}} {{t 'machine.driverDigitalocean.imageChoices.disk'}}, {{choice.vcpus}} {{t 'machine.driverDigitalocean.imageChoices.vCpu'}} </option>
<option value={{choice.slug}} selected={{eq digitaloceanConfig.size choice.slug}}>{{t 'machine.driverDigitalocean.sizeLabel' slug=choice.slug disk=choice.disk vcpus=choice.vcpus}}</option>
{{/each}}
</select>
</div>

View File

@ -1,7 +1,7 @@
<section class="horizontal-form">
<form>
<div class="container-fluid">
<div class="over-hr r-mt20 r-mb20">
<div class="over-hr r-mb20">
<span>{{t 'machine.driverExoscale.accountSection'}}</span>
</div>

View File

@ -1,7 +1,7 @@
<section class="horizontal-form">
<form name="login">
<div class="container-fluid">
<div class="over-hr r-mt20 r-mb20">
<div class="over-hr r-mb20">
<span>{{t 'machine.driverUbiquity.accountSection'}}</span>
</div>

View File

@ -6,7 +6,7 @@
</section>
{{#if model.apiHostSet}}
<section class="well">
<section class="well r-mb0">
{{#if showPicker}}
<div class="nav nav-boxes checked-active">
@ -33,17 +33,15 @@
</section>
{{#if driver}}
<section>
{{component (if (or (not driverObj) driverObj.hasUi) (concat "machine/driver-" driver) 'machine/driver-other')
cancel=(route-action 'cancel')
goBack=(route-action 'goBack')
clonedModel=model.clonedModel
driver=(concat driver 'Config')
schemas=model.schemas
typeDocumentations=model.typeDocumentations
availableDrivers=model.availableDrivers
}}
</section>
{{component (if (or (not driverObj) driverObj.hasUi) (concat "machine/driver-" driver) 'machine/driver-other')
cancel=(route-action 'cancel')
goBack=(route-action 'goBack')
clonedModel=model.clonedModel
driver=(concat driver 'Config')
schemas=model.schemas
typeDocumentations=model.typeDocumentations
availableDrivers=model.availableDrivers
}}
{{/if}}
{{else}}
<section>

View File

@ -104,7 +104,6 @@ export default Ember.Route.extend({
break;
case 'deployment':
fn = k8s.getDeployment;
label = 'Deployment';
break;
default:
return Ember.RSVP.reject('Unknown Kind');

View File

@ -1,23 +1,18 @@
<div class="row form-group">
<div class="col-xs-12">
<div class="form-label">
<label>{{t 'hostPartial.host.addCommon.quanity'}}</label>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-xs-2 col-md-1">
{{count}}
</div>
<div class="col-xs-10 col-md-11">
{{input-slider value=count valueMin=1 valueMax=11}}
</div>
</div>
{{form-name-description
{{#form-name-description
name=prefix
namePlaceholder="hostPartial.host.addCommon.new.form.name.placeholder"
nameHelpText=nameCountLabel
description=primaryResource.description
descriptionShown=false
}}
<div class="form-label">
<label class="form-control-static">{{t 'hostPartial.host.addCommon.quanity'}}</label>
</div>
<div class="row form-control-static">
<div class="col-xs-2 col-md-1">
{{count}}
</div>
<div class="col-xs-10 col-md-11">
{{input-slider value=count valueMin=1 valueMax=11}}
</div>
</div>
{{/form-name-description}}

View File

@ -1,21 +0,0 @@
import {
moduleForComponent,
test
} from 'ember-qunit';
moduleForComponent('radio-button', 'RadioButtonComponent', {
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
});
test('it renders', function(assert) {
assert.expect(2);
// creates the component instance
var component = this.subject();
assert.equal(component._state, 'preRender');
// appends the component to the page
this.append();
assert.equal(component._state, 'inDOM');
});

View File

@ -2155,7 +2155,7 @@ machine:
provided: Provided
region:
label: Region
accessKeyHelp: Paste in your AWS key pair here. We'll use this key to create your new Instances.
accessKeyHelp: "Paste in your AWS key pair here. We'll use this key to create your new Instances."
loginAction: "Next: Authenticate & select a network"
loadingAvailability: Loading Availablility Zone and VPC info from EC2...
vpcSection: Availability Zone & VPC
@ -2242,7 +2242,7 @@ machine:
step2: "Make sure any security groups or firewalls allow traffic:"
step2li: From and To all other hosts on <code>UDP</code> ports <code>500</code> and <code>4500</code> <span class="text-muted">(for IPsec networking)</span>
step3: "Optional: Add labels to be applied to the host."
step4: "Optional: Specify the public IP that should be used for this host. This is required if you're trying to add the host the <code>{rancherImage}</code> container is on."
step4: "Optional: Specify the public IP that should be used for this host. This is required if you're trying to add the host the <code>{rancherImage}</code> container is on."
step5Copy: Copy, paste, and run the command below to register the host with
generating: Generating registration URL...
step5Close:
@ -2252,11 +2252,11 @@ machine:
close: Close
driverDigitalocean:
imageChoices:
gb: gb
ram: RAM
vCpu: vCPU
disk: Disk
sizeLabel: |
{slug} RAM, {disk}gb Disk, {vcpus, plural,
=1 {# vCPU}
other {# vCPUs}
}
accountSection: Account Access
authAccountButton: 'Next: Configure Droplet'
accessToken: