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'), }.property('columnWidth','columnFudge'),
onResize: function() { onResize: function() {
if ( this.isDestroyed || this.isDestroying ) {
return;
}
try { try {
let elem = this.$(); let elem = this.$();
let sectionWidth = $('#application').width(); // On first call the pods aren't rendered yet, so approximate with the screen width 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({ return Ember.RSVP.hash({
instances: store.findAll('instance'), instances: store.findAll('instance'),
hosts: store.findAll('host'), hosts: store.findAll('host'),
}).then((hash) => { }).then(() => {
return store.all('container'); return store.all('container');
}); });
}, },

View File

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

View File

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

View File

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