mirror of https://github.com/rancher/ui.git
Sidekick fixes
This commit is contained in:
parent
cd87a82884
commit
ae3b66ca8d
|
|
@ -43,6 +43,9 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
|
|||
var ary = this.get('service.secondaryLaunchConfigs');
|
||||
ary.pushObject(this.get('store').createRecord({
|
||||
type: 'secondaryLaunchConfig',
|
||||
tty: true,
|
||||
stdinOpen: true,
|
||||
restartPolicy: {name: 'always'},
|
||||
}));
|
||||
this.send('selectLaunchConfig', ary.get('length')-1);
|
||||
},
|
||||
|
|
@ -139,7 +142,11 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
|
|||
(this.get('scaleLabels')||[]).forEach((row) => { out[row.key] = row.value; });
|
||||
(this.get('schedulingLabels')||[]).forEach((row) => { out[row.key] = row.value; });
|
||||
|
||||
this.set('launchConfig.labels', out);
|
||||
var config = this.get('launchConfig');
|
||||
if ( config )
|
||||
{
|
||||
this.set('launchConfig.labels', out);
|
||||
}
|
||||
}
|
||||
),
|
||||
|
||||
|
|
|
|||
|
|
@ -1,56 +1,53 @@
|
|||
<section class="horizontal-form container-fluid">
|
||||
{{#unless isSidekick}}
|
||||
{{#unless isSidekick}}
|
||||
<section class="horizontal-form container-fluid">
|
||||
<h2>Add
|
||||
{{#if isService}}
|
||||
Service
|
||||
{{#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}}
|
||||
{{else}}
|
||||
Container
|
||||
{{/if}}
|
||||
</h2>
|
||||
{{top-errors errors=errors}}
|
||||
{{/unless}}
|
||||
|
||||
{{#if (and isService (not isSidekick))}}
|
||||
{{form-scale
|
||||
initialLabels=launchConfig.labels
|
||||
initialScale=service.scale
|
||||
isGlobal=isGlobal
|
||||
errors=scaleErrors
|
||||
setLabels=(action 'setLabels' 'scale')
|
||||
setGlobal=(action 'setGlobal')
|
||||
setScale=(action 'setScale')
|
||||
}}
|
||||
{{#if (and isService (not isSidekick))}}
|
||||
{{form-scale
|
||||
initialLabels=launchConfig.labels
|
||||
initialScale=service.scale
|
||||
isGlobal=isGlobal
|
||||
errors=scaleErrors
|
||||
setLabels=(action 'setLabels' 'scale')
|
||||
setGlobal=(action 'setGlobal')
|
||||
setScale=(action 'setScale')
|
||||
}}
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-12 col-md-2 form-label r-mt5">
|
||||
<label>Sidekicks</label>
|
||||
</div>
|
||||
{{form-divider}}
|
||||
|
||||
<div class="col-sm-12 col-md-8">
|
||||
{{#if hasSidekicks}}
|
||||
<nav>
|
||||
<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>
|
||||
{{#each service.secondaryLaunchConfigs as |slc index|}}
|
||||
<li class="{{if (eq launchConfigIndex index) 'active'}}"><a href="#" {{action "selectLaunchConfig" index}}>{{default-str slc.name (concat-str '(Sidekick #' (one-louder index) ')')}}</a></li>
|
||||
{{/each}}
|
||||
<li><a {{action "addSidekick"}} tooltip="Add Sidekick"><i class="icon icon-plus"/></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{else}}
|
||||
<button class="btn-circle-plus btn-circle-text" style="margin-right: 20px;" {{action "addSidekick"}}>Add Sidekick</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{#if hasSidekicks}}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-2 form-label r-mt5">
|
||||
<label>Service</label>
|
||||
</div>
|
||||
|
||||
{{form-divider}}
|
||||
|
||||
{{/if}}
|
||||
</section>
|
||||
<div class="col-sm-12 col-md-8">
|
||||
<nav>
|
||||
<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>
|
||||
{{#each service.secondaryLaunchConfigs as |slc index|}}
|
||||
<li class="{{if (eq launchConfigIndex index) 'active'}}"><a href="#" {{action "selectLaunchConfig" index}}>{{default-str slc.name (concat-str '(Sidekick #' (one-louder index) ')')}}</a></li>
|
||||
{{/each}}
|
||||
<li><a {{action "addSidekick"}} tooltip="Add Sidekick"><i class="icon icon-plus"/></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</section>
|
||||
{{/unless}}
|
||||
|
||||
<div data-launchindex="-1">
|
||||
<section class="horizontal-form container-fluid">
|
||||
|
|
@ -165,6 +162,9 @@
|
|||
|
||||
{{#unless isSidekick}}
|
||||
{{#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)}}
|
||||
<button class="btn btn-default" {{action "removeSidekick"}}>Remove this Sidekick</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue