mirror of https://github.com/rancher/ui.git
Remove sidekick
This commit is contained in:
parent
348b33b8ac
commit
cd87a82884
|
|
@ -47,6 +47,18 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
|
|||
this.send('selectLaunchConfig', ary.get('length')-1);
|
||||
},
|
||||
|
||||
removeSidekick() {
|
||||
var idx = this.get('launchConfigIndex');
|
||||
var ary = this.get('service.secondaryLaunchConfigs');
|
||||
ary.removeAt(idx);
|
||||
if ( idx >= ary.get('length') )
|
||||
{
|
||||
Ember.run.next(() => {
|
||||
this.send('selectLaunchConfig', ary.get('length')-1);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setScale(scale) {
|
||||
this.set('service.scale', scale);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,30 +1,20 @@
|
|||
<section class="horizontal-form container-fluid">
|
||||
{{#unless isSidekick}}
|
||||
<h2>Add {{if isService 'Service' 'Container'}}</h2>
|
||||
<h2>Add
|
||||
{{#if isService}}
|
||||
Service
|
||||
{{#if hasSidekicks}}
|
||||
+
|
||||
{{service.secondaryLaunchConfigs.length}} Sidekick{{if (not-eq service.secondaryLaunchConfigs.length 1) 's'}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
Container
|
||||
{{/if}}
|
||||
</h2>
|
||||
{{top-errors errors=errors}}
|
||||
{{/unless}}
|
||||
|
||||
{{#if (and isService (not isSidekick))}}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-12 col-md-2 form-label r-mt5">
|
||||
<label>Sidekicks</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-8">
|
||||
<nav>
|
||||
<ul class="pagination pagination-sm r-m0">
|
||||
{{#if hasSidekicks}}
|
||||
<li class="{{if (eq launchConfigIndex -1) 'active'}}"><a href="#" {{action "selectLaunchConfig" -1}}>{{default-str service.name default="(Primary Service)"}}</a></li>
|
||||
{{/if}}
|
||||
{{#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>
|
||||
|
||||
{{form-scale
|
||||
initialLabels=launchConfig.labels
|
||||
initialScale=service.scale
|
||||
|
|
@ -35,6 +25,28 @@
|
|||
setScale=(action 'setScale')
|
||||
}}
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-12 col-md-2 form-label r-mt5">
|
||||
<label>Sidekicks</label>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
{{form-divider}}
|
||||
|
||||
{{/if}}
|
||||
|
|
@ -152,5 +164,9 @@
|
|||
{{/if}}
|
||||
|
||||
{{#unless isSidekick}}
|
||||
{{save-cancel save="save" cancel="cancel"}}
|
||||
{{#save-cancel save="save" cancel="cancel"}}
|
||||
{{#if (not-eq launchConfigIndex -1)}}
|
||||
<button class="btn btn-default" {{action "removeSidekick"}}>Remove this Sidekick</button>
|
||||
{{/if}}
|
||||
{{/save-cancel}}
|
||||
{{/unless}}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{{yield}}
|
||||
{{#if saving}}
|
||||
<button class="btn btn-primary btn-disabled"><i class="icon icon-spinner icon-spin"></i> Saving...</button>
|
||||
{{else}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue