Sidekick fixes

This commit is contained in:
Vincent Fiduccia 2015-10-19 14:05:23 -07:00
parent cd87a82884
commit ae3b66ca8d
2 changed files with 46 additions and 39 deletions

View File

@ -43,6 +43,9 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
var ary = this.get('service.secondaryLaunchConfigs'); var ary = this.get('service.secondaryLaunchConfigs');
ary.pushObject(this.get('store').createRecord({ ary.pushObject(this.get('store').createRecord({
type: 'secondaryLaunchConfig', type: 'secondaryLaunchConfig',
tty: true,
stdinOpen: true,
restartPolicy: {name: 'always'},
})); }));
this.send('selectLaunchConfig', ary.get('length')-1); this.send('selectLaunchConfig', ary.get('length')-1);
}, },
@ -139,8 +142,12 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
(this.get('scaleLabels')||[]).forEach((row) => { out[row.key] = row.value; }); (this.get('scaleLabels')||[]).forEach((row) => { out[row.key] = row.value; });
(this.get('schedulingLabels')||[]).forEach((row) => { out[row.key] = row.value; }); (this.get('schedulingLabels')||[]).forEach((row) => { out[row.key] = row.value; });
var config = this.get('launchConfig');
if ( config )
{
this.set('launchConfig.labels', out); this.set('launchConfig.labels', out);
} }
}
), ),
// ---------------------------------- // ----------------------------------

View File

@ -1,18 +1,17 @@
<section class="horizontal-form container-fluid">
{{#unless isSidekick}} {{#unless isSidekick}}
<section class="horizontal-form container-fluid">
<h2>Add <h2>Add
{{#if isService}} {{#if isService}}
Service Service
{{#if hasSidekicks}} {{#if hasSidekicks}}
+ +
{{service.secondaryLaunchConfigs.length}} Sidekick{{if (not-eq service.secondaryLaunchConfigs.length 1) 's'}} {{service.secondaryLaunchConfigs.length}} Sidekick Service{{if (not-eq service.secondaryLaunchConfigs.length 1) 's'}}
{{/if}} {{/if}}
{{else}} {{else}}
Container Container
{{/if}} {{/if}}
</h2> </h2>
{{top-errors errors=errors}} {{top-errors errors=errors}}
{{/unless}}
{{#if (and isService (not isSidekick))}} {{#if (and isService (not isSidekick))}}
{{form-scale {{form-scale
@ -25,13 +24,15 @@
setScale=(action 'setScale') setScale=(action 'setScale')
}} }}
<div class="row form-group"> {{form-divider}}
{{#if hasSidekicks}}
<div class="row">
<div class="col-sm-12 col-md-2 form-label r-mt5"> <div class="col-sm-12 col-md-2 form-label r-mt5">
<label>Sidekicks</label> <label>Service</label>
</div> </div>
<div class="col-sm-12 col-md-8"> <div class="col-sm-12 col-md-8">
{{#if hasSidekicks}}
<nav> <nav>
<ul class="pagination pagination-sm r-m0"> <ul class="pagination pagination-sm r-m0">
<li class="{{if (eq launchConfigIndex -1) 'active'}}"><a href="#" {{action "selectLaunchConfig" -1}}>{{default-str service.name default="(Primary Service)"}}</a></li> <li class="{{if (eq launchConfigIndex -1) 'active'}}"><a href="#" {{action "selectLaunchConfig" -1}}>{{default-str service.name default="(Primary Service)"}}</a></li>
@ -41,16 +42,12 @@
<li><a {{action "addSidekick"}} tooltip="Add Sidekick"><i class="icon icon-plus"/></a></li> <li><a {{action "addSidekick"}} tooltip="Add Sidekick"><i class="icon icon-plus"/></a></li>
</ul> </ul>
</nav> </nav>
{{else}} </div>
<button class="btn-circle-plus btn-circle-text" style="margin-right: 20px;" {{action "addSidekick"}}>Add Sidekick</button> </div>
{{/if}} {{/if}}
</div>
</div>
{{form-divider}}
{{/if}} {{/if}}
</section> </section>
{{/unless}}
<div data-launchindex="-1"> <div data-launchindex="-1">
<section class="horizontal-form container-fluid"> <section class="horizontal-form container-fluid">
@ -165,6 +162,9 @@
{{#unless isSidekick}} {{#unless isSidekick}}
{{#save-cancel save="save" cancel="cancel"}} {{#save-cancel save="save" cancel="cancel"}}
{{#if isService}}
<button class="btn btn-default" {{action "addSidekick"}}>Add a Sidekick</button>
{{/if}}
{{#if (not-eq launchConfigIndex -1)}} {{#if (not-eq launchConfigIndex -1)}}
<button class="btn btn-default" {{action "removeSidekick"}}>Remove this Sidekick</button> <button class="btn btn-default" {{action "removeSidekick"}}>Remove this Sidekick</button>
{{/if}} {{/if}}