Fix swarm with no hosts

This commit is contained in:
Vincent Fiduccia 2016-11-29 12:47:33 -07:00
parent 1f8ebcb097
commit d3e527a30c
5 changed files with 21 additions and 20 deletions

View File

@ -30,6 +30,10 @@ export default Ember.Component.extend(ThrottledResize, {
}.property('columnWidth','columnFudge'),
onResize: function() {
if ( this.isDestroyed || this.isDestroying ) {
return;
}
try {
let elem = this.$();
let sectionWidth = $('#application').width(); // On first call the pods aren't rendered yet, so approximate with the screen width

View File

@ -6,7 +6,7 @@ export default Ember.Route.extend({
return Ember.RSVP.hash({
instances: store.findAll('instance'),
hosts: store.findAll('host'),
}).then((hash) => {
}).then(() => {
return store.all('container');
});
},

View File

@ -7,8 +7,7 @@ export default Ember.Route.extend({
return Ember.RSVP.all([
store.findAll('service'),
store.findAll('container'),
store.findAll('virtualmachine'),
store.findAll('instance'),
]).then(() => {
return host;
});

View File

@ -15,10 +15,6 @@ export default Ember.Route.extend({
instance: inst,
});
}
else
{
return Ember.RSVP.reject('Unable to find an active Swarm container');
}
});
},
});

View File

@ -1,14 +1,16 @@
<section class="header">
<h1 style="display: block">{{t 'dockerCLI.header'}}</h1>
</section>
{{#if model.instance}}
<section class="header">
<h1 style="display: block">{{t 'dockerCLI.header'}}</h1>
</section>
<section class="well">
{{container-shell
classNames="inline-block"
command=model.command
instance=model.instance
cols=120
rows=30
showProtip=false
}}
</section>
<section class="well">
{{container-shell
classNames="inline-block"
command=model.command
instance=model.instance
cols=120
rows=30
showProtip=false
}}
</section>
{{/if}}